Protons and neutrons have equal masses. The relative masses of a proton and neutron are both one unit. The mass of an electron is very small compared with a proton or neutron, and so the mass of an atom is made up almost entirely of its protons and neutrons. The total number of protons and neutrons in an atom is called its 'mass number.'
Atoms of the same element all have the same atomic number. The number of protons and electrons in an atom must always be the same, but there can be different numbers of neutrons. Atoms of the same element with different numbers of neutrons are called 'isotopes'. The number of neutrons in an atom is equal to its mass number minus its atomic number.