The analysis of the potential energies is a bit more involved than you think.
Suppose we start with the mass on the spring in it's equilibrium position i.e. extended by $\Delta x$. Suppose we lift the mass by $\Delta x$ so the spring is now unextended. The spring PE has reduced by $\tfrac{1}{2}k\Delta x^2$ and the mass PE has increased by $mgh$ - so far so good.
But the increase in the PE of the mass didn't come only from the work done on it by the spring. You had to put your hand under the mass and exert a force to lift the mass. So the increase in PE of the mass has come from two sources:
the work done by the spring i.e. the decrease in the spring PE
the work you did on the mass
So your equation relating the changes in PE should be:
$$ mg\Delta x = \tfrac{1}{2}k\Delta x^2 + W_\text{you} \tag{1} $$
where $W_\text{you}$ is the work you did on the mass. You have omitted this term from your second equation, and that's why it gives the wrong answer.
It's easy to calculate $W_\text{you}$ because the force you have to exert to lift the mass is just:
$$ F = mg - kx $$
And we get the work by integrating this:
$$ W_\text{you} = \int_0^{\Delta x} \left(mg - kx\right)\,dx = mg\Delta x - \tfrac{1}{2}k\Delta x^2 $$
Substituting this in equation (1) gives:
$$ mg\Delta x = \tfrac{1}{2}k\Delta x^2 + mg\Delta x - \tfrac{1}{2}k\Delta x^2 = mg\Delta x $$
Which is true, though unhelpful.
Now let's go back to the scenario you describe i.e. we start with the spring unextended and the mass stationary, then we let go of the mass. The mass will now oscillate up and down. When the mass has reached the point where the forces balance, i.e. $x = mg/k$, it has kinetic energy and your equation for the energy balance needs to include this. We'd get:
$$ mgx = \tfrac{1}{2} kx^2 + \tfrac{1}{2}mv^2 $$
where $v$ is the velocity of the mass.
A quick footnote:
I see the question has been closed as homework like, and I guess that's justified, but there is an important conceptual point here. When you do an energy balance you need to include all the energy changes involved. Your approach gives the wrong answer because it omits either the work you do on the spring by lifting it, or the kinetic energy of the mass if you let if fall freely.