The question is somewhat misleading.
Any lump of matter has a certain amount of mass. The mass is a property of that lump, and it doesn't change, no matter what happens to the lump or where it goes.
But the WEIGHT of the lump depends on what else is around, because the weight is the strength of the gravitational force on it, caused by some OTHER mass. The weight can change, because it depends on the OTHER mass.
The gravitational force changes the WEIGHT of the lump of matter, but that's not really a property of the matter.