Answer
(a) $0.037\space m$
(b) $0.074\space m$
Work Step by Step
(a) Let's apply the equation $F=kx$ to find the compression of the spring.
$F=kx$
$mg=kx=> x=\frac{mg}{k}$ ; Let's plug known values into this equation.
$x=\frac{(0.64\space kg)(9.8\space m/s^{2})}{170\space N/m}=0.037\space m$
(b) Here we use the principle of conservation of mechanical energy to find the compression of the spring.
Initial mechanical energy = Final mechanical energy
$0+mgh_{0}+0=0+mgh_{f}+\frac{1}{2}kx^{2}$
$\frac{1}{2}kx^{2}=mg(h_{0}-h_{f})$
We can get, $h_{0}-h_{f}=x$ So,
$\frac{1}{2}kx^{2}=mgx=>x=\frac{2mg}{k}$
$x=\frac{2(0.64\space kg)(9.8\space m/s^{2})}{170\space N/m}=0.074\space m$
The spring compresses more in the non-equilibrium situation as expected.