The atomic number tells you how many protons the element has.
The atomic number also tells you how many electrons the atom has. The number of electrons is always equal to the number of protons.
Within the periodic table, elements are neutral. The positive charge (+ve) of the protons cancels out (and neutralises) the negative charge (-ve) of the electrons.
The number of protons must equal the number of electrons because the elements in the periodic table are neutral.