Hold a 1 kg bag of flour on your outstretched hand. The downward tug you feel is Earth's gravity pulling on the flour: its weight, about 9.8 N. Hold two bags and the tug doubles to 19.6 N. Near Earth's surface every kilogram is pulled down with about 9.8 N, which is what g=9.8 N/kg means, and that gives W=mg.
The pull depends on where you are. The Moon's gravity is weaker, so the same 1 kg bag weighs only about 1.6 N there, while on Jupiter it would weigh about 24.8 N. The flour itself has not changed: its mass is 1 kg everywhere. Weight always points toward the centre of the planet or moon doing the pulling, which on Earth is the direction we call down.
What a bathroom scale shows is not always your weight. A scale measures how hard you press on it. Standing still, that push equals your weight. In a lift that is starting to rise, the floor must push you up harder to speed you up, so the scale reads more, even though gravity's pull on you has not changed. Everyday scales also display kilograms, because they divide the push by 9.8 for you. In physics a weight is always in newtons, and a number in kilograms is a mass.
Think of it like this. Weight is a planet's grip on you. Earth grips each kilogram with about 9.8 N and the Moon with only 1.6 N, so the same backpack feels six times lighter there while holding exactly the same books. Travel far from every planet and the grip fades almost to nothing, yet the books are all still there.
Core idea. Weight is the force of gravity on an object, W=mg, measured in newtons and pointing toward the centre of the planet. It changes from place to place, while the object's mass stays the same.