An atom is electrically neutral, i.e. the positive charge is equal to and balanced by the negative charge so the number of protons in the nucleus is the same as the number of electrons surrounding the nucleus
There are the same number of electrons as there are protons in the nucleus, so the number of electrons in an atom can also be found by reading the atomic number on a periodic table