BEFORE QUESTION EDIT (Pivot in the middle)
This is actually not always true. In general, the gravitational potential energy is given as $U=mgh$, so the gravitational potential energy for each object is then:
$U_1=m_1gh_1$
$U_2=m_2gh_2$
And so the total gravitational potential energy is
$U=m_1gh_1+m_2gh_2=g(m_1h_1+m_2h_2)$
Now, let's start the see-saw at a level position and say that in this position $U=g(m_1h_1+m_2h_2)=0$. In other words, let's say at this position $h_1=h_2=0$. If potential energy remains constant, then $U=0$ must be true at any orientation
Now if we rotate the see-saw in either direction, we can argue through symmetry that $h_2=-h_1$. Therefore $U=gh_1(m_1-m_2)$. So we can see that the only way to keep our potential at $0$ is for the masses to be equal. If this is not the case then the potential energy changes. For example, let's say $m_1>m_2$. Then if we move $m_1$ up and $m_2$ down, we see that $U>0$. This is because gravity is doing more negative work on $m_1$ than it is doing positive work on $m_2$.
Therefore, the only way for your statement to be true is if $m_1=m_2$. In this case gravity is always doing equal but opposite amounts of work on the objects, and so the potential energy is not changing.
GENERAL CASE (Pivot located so net torque is always 0)
If net torque is $0$, then the following is true:
$m_1gx=m_2g(L-x)$ where the see-saw has length $L$ and $x$ is the distance between $m_1$ and the pivot. Expressing $m_2$ in terms of $m_1$ then gives
$m_2=\frac{m_1x}{L-x}$
Now if we think about rotating the see-saw to some angle $\theta$, we can use trigonometry to show that
$h_1=xsin(\theta)$
$h_2=-(L-x)sin(\theta)$ (the negative sign is present since if $h_1$ increases, $h_2$ must decrease)
So then if we combine all of our work we get
$U=g(m_1h_1+m_2h_2)=g[m_1xsin(\theta)-\frac{m_1x}{L-x}(L-x)sin(\theta)]=0$
Therefore, no matter the angle $U=0$ (or it will stay at some constant value).
You could also make a more qualitative argument that the system will move so that potential energy is minimized. At any angle the system will not move (since net torque about the pivot will always be 0), so you can argue that the potential energy must be constant at all angles.