Dear Student,
Spring constant(k) depends on:-
1) The stiffness of the spring material,
2) The thickness of the wire from which the spring is wound
3)Diameter of the turns of the coil,
4)The number of turns per unit length and the overall length of the spring.
Since all these parameters remain constant for spring whether the spring is on earth or on the moon.
Therefore
Regards
.