Weight is the force acting on an object because of the gravitational field it is in. Like any force it is measured in newtons (N), and it acts downwards, towards the centre of the Earth. Mass is different. Mass is the amount of matter in an object, measured in kilograms (kg), and it stays the same wherever the object is.
Weight is measured with a newton meter, which is a calibrated spring balance. The object hangs from the hook and stretches the spring. The bigger the weight, the more the spring stretches, and the scale reads the force in newtons.
Weight depends on the gravitational field strength, which is the force on each kilogram of mass and has the unit N/kg. At the Earth's surface the gravitational field strength is 10 N/kg. The relationship is: weight (N) = mass (kg) × gravitational field strength (N/kg).
A 5 kg bag on Earth has a weight of 5 × 10 = 50 N. On the Moon the gravitational field strength is only about 1.6 N/kg, so the same bag weighs 5 × 1.6 = 8 N. Its mass is still 5 kg.