The mass of 100 g is placed on a spring with a spring constant 250 N/m and pushed down 10 cm. When a spring with a spring constant k is pushed down by a distance x, an energy equal to (1/2)*k*x^2 is stored in the spring.
The energy stored in the spring with a spring constant 250 N/m when it is pushed down 10 cm is (1/2)*250*0.1^2 = 1.25 J
The gravitational potential energy of a mass m at a height h is equal to m*g*h. When the spring is released the mass of 100 g is pushed upwards and moves till its gravitational potential energy is equal to the energy that was stored in the spring.
This gives 0.1*9.8*h = 1.25
=> h = 0.127 m
The mass of 100 g moves to a height of 0.127 m when the spring is released.