Answer
$x = 3.64~cm$
Work Step by Step
The block reaches its greatest speed when the force on the block from the spring is equal in magnitude to the component of gravitational force on the block that is directed down the ramp.
We can find the distance $x$ that the spring is compressed at this point:
$kx = mg~sin~\theta$
$x = \frac{mg~sin~\theta}{k}$
$x = \frac{(3.20~kg)(9.80~m/s^2)~sin~30^{\circ}}{431~N/m}$
$x = 0.0364~m$
$x = 3.64~cm$