A nucleon has more mass when it is not bound to the nucleus of an atom.
When the nucleon is bound to other nucleons the binding energy that keeps them together comes from the mass of the nucleon. Therefore the mass of a single nucleon will be smaller in an atom than on it's own.