When you find a minimum in the thermodynamic potential energy of a system, you will have found an equilibrium point.
The key is the thermodynamic potential part. Depending on the constraints of the system (i.e. which thermodynamic state variables are held constant) the thermodynamic potential energy function will be different.
For example, in a system of a fixed number of particles at constant temperature and pressure (we would call it NPT), the Gibbs free energy is the thermodynamic potential, and it will be minimized at equilibrium.
For NVT (constant volume and temperature) the Helmholtz free energy is the thermodynamic potential, and that is what will be minimized at equilibrium.
In a system consisting of a rock dropped from a height above the ground, gravitational potential energy is the thermodynamic potential (I am abusing the language a little bit here) and it will be minimized at equilibrium (when the rock hits the ground).