The atomic number is the number of protons in an atom. The mass number is the total number of protons and neutrons in the nucleus. In the standard notation the mass number is written at the top left of the symbol and the atomic number at the bottom left, for example 2311Na.
To work out the particles in an atom: protons = atomic number, electrons = atomic number (the atom has no overall charge), neutrons = mass number − atomic number. For sodium, 2311Na, that gives 11 protons, 11 electrons and 12 neutrons.
An ion is a charged atom. An atom becomes a positive ion when it loses electrons and a negative ion when it gains electrons. The number of protons never changes. Na+ has lost one electron, so it has 11 protons and 10 electrons. An oxide ion O2- (atomic number 8, mass number 16) has gained 2 electrons, so it has 8 protons, 8 neutrons and 10 electrons.
Isotopes are atoms of the same element with the same number of protons but different numbers of neutrons, so they have the same atomic number but different mass numbers.