Question: how to determine how many electrons an atom has?
Answer: The number of protons in the nucleus of the atom is equal to the atomic number (Z).
The number of electrons in a neutral atom is equal to the number of protons.