Mass on a Vertical Spring

A mass is oscillating vertically at the end of a spring. Do we need to include gravitational potential energy in energy conservation?

We don't need to!!

Why? Measure the displacement dx with respect to the equilibrium position of the mass attached to the spring. In this reference frame that force of gravity is always canceled by the force of the spring that is stretched to the new equilibrium length x0 (see transparency).