If the ion is monoatomic it formed from a single atom gaining or losing electrons. In this case the number of protons is the same as the atomic number for that element.
This video gives further explanation of monoatomic ions.
Polyatomic ions are a bit more complicated. These ions contain more than one atom which are bonded together to form a charged particle. Here you will need to add the protons from each atom which is present in the polyatomic ion.
This video gives further explanation of polyatomic ions.
Hope this helps!