The presence of positive charge on the nucleus is due to the protons in the nucleus. As established earlier, the charge on the proton is equal but opposite to that of electron. The number of protons present in the nucleus is equal to atomic number (Z).
For example, the number of protons in the hydrogen nucleus is 1, in sodium atom it is 11, therefore their atomic numbers are 1 and 11 respectively. In order to keep the electrical neutrality, the number of electrons in an atom is equal to the number of protons (atomic number. 2). For example, number of electrons in hydrogen atom and sodium atom are 1 and 11 respectively.
Atomic number (Z) = number of protons in the nucleus of an atom
= number of electrons in a nuetral atom.