Answer
The object slides a distance of 0.33 meters up the incline.
Work Step by Step
The gravitational potential energy at the highest point will be equal to the elastic potential energy stored in the spring initially. Note that the maximum height $h$ is equal to $d~sin~\theta$, where $d$ is the distance the object slides up the incline.
We can find the distance $d$:
$mgh = \frac{1}{2}kx^2$
$mgd~sin~\theta = \frac{1}{2}kx^2$
$d = \frac{kx^2}{2mg~sin~\theta}$
$d = \frac{(40.0~N/m)(0.20~m)^2}{(2)(0.50~kg)(9.80~m/s^2)~sin~30.0^{\circ}}$
$d = 0.33~m$
The object slides a distance of 0.33 meters up the incline.