The size of an ion is determined by the attractive force of the protons in the nucleus and the repulsive force of electrons in the electron cloud.
An atom loses electrons to be a positive ion or can be named a cation. Now, when it happens, there are more protons which causes more positive charge in the atom. So, the remaining electrons in the electron cloud are more strongly attracted to the nucleus and cause the ion to be smaller in size than the original atom.
Whereas, an atom gains electrons to be negative ions or can be named an anion. Now, when it happened, there are more electrons in the electron cloud than the number of protons in the nucleus. So, the repulsive force in the electron cloud will be higher and thus the ion will be larger.