The atomic number is the number of protons in an atom and it decides which element the atom is. The mass number is the number of protons plus the number of neutrons. The number of neutrons is therefore the mass number minus the atomic number. In standard notation the mass number is written above the atomic number, next to the symbol, for example 2311Na.
A neutral atom has equal numbers of protons and electrons. Sodium, 2311Na, has 11 protons, 12 neutrons (23 - 11) and 11 electrons. Isotopes are atoms of the same element with the same number of protons but different numbers of neutrons, so they have different mass numbers. Chlorine-35 has 17 protons and 18 neutrons, and chlorine-37 has 17 protons and 20 neutrons.
An ion is a charged particle formed when an atom gains or loses electrons. The number of protons does not change, so the nucleus is unchanged. A sodium ion, Na+, has lost one electron, so it has 11 protons, 12 neutrons and 10 electrons. A chloride ion, Cl-, has gained one electron, so it has 17 protons, 18 neutrons and 18 electrons. A 2+ ion has lost two electrons, so a magnesium ion Mg2+ (atomic number 12, mass number 24) has 12 protons, 12 neutrons and 10 electrons.