Two atoms have the same number of protons, they are the same element. If they have a different number of protons, they are different elements. However, two atoms can have the same number of protons but different numbers of neutrons.
Electrons in atoms occupy energy levels, also called electron shells, outside the nucleus. Different shells can hold different maximum numbers of electrons.
The electronic structure of an atom can be predicted from its atomic number. For example, the atomic number of sodium is 11. Sodium atoms have 11 electrons: 2 in the first shell, 8 in the second shell, and 1 in the third shell.