The gram measures mass, the amount of matter an object contains. Mass stays the same regardless of the gravitational pull. But, on Earth, mass also measures weight which is why you can switch from grams to pounds or ounces.