Which approach to take with a vertical spring? Lets say we have a spring hanging vertically with spring constant $k$ attached to a  block of mass $m$. The system is at rest. 
Then, you pull the mass downwards, extending the spring by distance $x$, then let go. 
The spring will, of course, bounce back to its original spot. What is the velocity of the object at its initial resting location?
To solve this, I took two approaches, but I'm not sure which one is right. 
The first is a work approach. When the block returns to its old location, it is the same except now has the new energy it recieved from the prior extention, so I can say...
$W=Fd$ or $W=\frac{1}{2}*k*x^2$. 
So, $\frac{1}{2}*k*x^2=\frac{1}{2}*m*v^2$ therefore $v=\sqrt{\frac{k}{m}}*abs(x)$.
However, I don't consider gravitational potential, which worries me. 
If we do so, we can say at the rest location the energy is just $mgh$ where $h$ is $x$.
At the bottom, the energy is just $\frac{1}{2}*k*x^2$ so... 
$mgx+\frac{1}{2}m*v^2=\frac{1}{2}k*x^2$ so $v=\sqrt{\frac{kx^2-2gmx}{m}}$
Which approach do I take? 
 A: Both approaches are actually the same, if you do them correctly.
I will address your second case first. You are correct to use conservation of energy and say that the potential energy stored in the spring at the lowest point is equal to the sum of the kinetic energy and the potential energy due to gravity at the equilibrium point. So you were correct with the equation
$$\frac12ky^2=mgy+\frac12mv^2$$
Let’s now look at the first case, but let's do it correctly. We know that the net work done on the mass is equal to its change in kinetic energy:
$$W_\text{net}=W_\text{gravity}+W_\text{spring}=\Delta K=\frac12mv^2-0$$
We can easily determine the work done by gravity and the spring force using the definition of work $W=\int\mathbf F\cdot\text d\mathbf y$
$$W_\text{gravity}=\int_{-y}^0(-mg)\,\text dy'=-mgy$$
$$W_\text{spring}=\int_{-y}^0(-ky')\,\text dy'=\frac12ky^2$$
Putting it all together we have
$$W_\text{net}=-mgy+\frac12ky^2=\frac12mv^2$$
You can see this is exactly the same as your second case. So both methods you have proposed are exactly the same. The issue with the first case in your question is just as you said. You didn't include work done by gravity.
