Mass is an intrinsic part of matter. Your mass does not change whether you are on the earth, in space, or on the moon.

Weight is a function of gravitational force.

Force = G(m1m2)/r^2

Force is in Newtons, which is convertible to weight ( G is a gravitational constant ) and m1 and m2 are the masses with r^2 being the radius between them squared.

So, when on the earth your mass and the earth's mass are very close so you weight is what is is on earth because the earth is a large body depressing space time deeper than the moon would, which is why on the moon you weigh less. Both bodies pull on each other as both depress space time, but you do not make much of an impression compared to the earth!

The above Newtonian equation shows how this is mechanically, but Einstein showed us why this.