Answer
$0.98J$
Work Step by Step
Lets assume that the initial position of marble on the spring is A and that B is the point where the marble can go maximum vertically.
The change in potential energy of the marble will be:
$\Delta U_{g}=U_{B}-U_{A}=mgH_{B}-mgH_{A}=mg\Delta H$
From the question, we know that $\Delta H=20m$ ( marble travels maximum 20 m vertically). Therefore,
$\Delta Ug=mg\Delta H\approx 5\times 10^{-3}kg\times 9.8\dfrac {m}{s^{2}}\times 20m\approx 0.98J$