The atoms in a sample of an element must contain nuclei with the same number of what?

With the same number of $\text{protons}$...........
The atoms in a sample of a given element all have the same $\text{atomic number}$, $Z$, which represents the number of $\text{protons}$, massive, positively charged nuclear particles. And $Z$ determines the identity of the element: $Z = 1 , \text{hydrogen}$; $Z = 2 , \text{helium}$; $Z = 6 , \text{carbon}$; .......$Z = 92 , \text{uranium}$.
The nucleus CAN contain different numbers of $\text{neutrons}$, and this gives rise to the existence of isotopes. Isotopes are nuclides of the same element (and thus common $Z$), with different numbers of neutrons. Most elements have a number of specific isotopes. The weighted average of their mass is the atomic mass printed on the Periodic Table.