Answer
The spring should be compressed a distance of 0.53 meters.
Work Step by Step
The work done by gravity on the brick as the brick moves up to a height $h$ is $W_g = -mgh$ Note that the brick's kinetic energy at the maximum height is zero.
$\frac{1}{2}kx^2 + W_g = 0$
$\frac{1}{2}kx^2 -mgh = 0$
$\frac{1}{2}kx^2 = mgh$
$x^2 = \frac{2mgh}{k}$
$x = \sqrt{\frac{2mgh}{k}}$
$x = \sqrt{\frac{(2)(1.80~kg)(9.80~m/s^2)(3.6~m)}{450~N/m}}$
$x = 0.53~m$
The spring should be compressed a distance of 0.53 meters.
The spring does not stretch after it returns to its uncompressed length because there is no force pulling on the spring to stretch it farther. Therefore, the brick loses contact with the spring when it returns to its uncompressed length.