If g is the acceleration due to gravity on earth, then acceleration due to gravity on moon is 6g.
So, when the spring-mass system is taken to the moon, then the FBD is as shown below.
In equilibrium, kx=6mg
where, k is spring constant and x is the extension in the spring. x=6kmg
Time period of oscillation for spring-mass system, T=2πkm
Since, the value of k is governed by the elastic properties of the spring only. Also, mass m remains same everywhere irrespective of its position.
Thus, time period T remains unchanged.