Ions are particles (atom or group of atoms) that carry a net positive or negative electrical charge.
Positively-charged ions are known as cations. Negatively charged ions are known as anions.
Atoms tend to gain or lose electrons in order to achieve a stable electronic structure. Atoms are stable when they have a fully filled valence shell (duplet or octet electron arrangement).
When an atom gains electrons, it becomes a negatively-charged ion (anion). When an atom loses electrons, it becomes a positively-charged ion (cation).