To solve this problem it is necessary to apply the concepts related to Work, Kinetic energy in springs and the conservation of Energy.
By definition work in a body is defined by

Where,
F = Force
d = Distance
On the other hand we have that

Where,
k = Spring constant
x = Displacement
Since it is an inclined plane, we can intuit that the component of the distance that allows the calculation of the work is the opposite of the angle (vertical), so




From the second equation we can calculate the displacement, then




Therefore the block come to rest when the spring has been compressed around to 11.49cm