How does atom become an ion?

An atom becomes an ion when it loses or gains an electron. An atom is electrically neutral. The protons and electrons are equal and balance each other. An ion is either positive or negative, depending on whether it gains or loses an electron. Thus the number of electrons will be either greater or less than the number of positively charged protons.