If you have an ideal spring with a mass m on it, and you measure a spring constant of

8 N/m, what do you expect to happen to the spring constant if you (be realistic):
a. Take it to the moon
b. Take it to the sun

Would the constant remain the same for both a and b?

the spring constant is a physical characteristic of the spring

... material, shape, length, etc.

the different gravities of the moon and sun won't change the constant