An astronaut travels from the Earth to the Moon.
Weight depends highly on the gravity that’s pulling you down (and the mass of the body in question) — in this case, Earth’s gravity.
An object will have the same mass at any point in space — be it on Earth or a far-away planet — but since Earth’s gravity fades the further into space we go away from Earth, the same way, weight will change. That’s the key difference between mass and gravity — mass only depends on how much matter a body is made of, while gravity depends on mass and gravity.