It makes sense to also assign mass numbers to the sub-atomic constituents:
- A proton has mass number $1$.
- A neutron has mass number $1$.
- An electron has mass number $0$.
With this definition you consistently get the mass number of an atom/ion by summing the mass numbers of its constituents. For example: the Na atom and the Na$^+$ ion both have mass number $23$.
Don't confuse these mass numbers from above with the actual masses of the sub-atomic constituents:
- An electron has mass $0.00055$ u.
- A free proton has mass $1.0073$ u.
- A free neutron has mass $1.0087$ u.
- Protons and neutrons bound inside a nucleus have slightly smaller masses (typically less by $0.008$ u) due to the nuclear binding energy.