Long story short, you're looking for a minimum in the potential energy. In most cases the tests described in the other answers will work well. The second derivative test discussed in previous answers can be inconclusive, though. In one dimension, when $U''=0$ you don't know if you have a minimum, maximum, or neither. To understand how to handle these more difficult situations, it's best to think of the potential energy as a Taylor series around the point of interest:
$$U(x) = U(a) + U'(a) (x-a) + \frac{U''(a)}{2}(x-a)^2 + \frac{U'''(a)}{3!}(x-a)^3 + \ldots$$
Your first requirement to be an equilibrium, is $U'(a)=0$. Your requirement for stability is then $U''(a) > 0$, unstable if $U''(a)<0$, inconclusive if $U''(a) = 0$.
If your test is inconclusive, and that is unacceptable, then you move to the next higher derivative, $U'''(a)$. The condition there is if $U'''(a) \neq0$ then your potential looks cubic there, so the equilibrium is meta-stable (saddle point - stable one direction, not the other). If $U'''(a) = 0$ you can look to the next higher derivative.
If $U^{\mathrm{IV}}(a) > 0$, and all previous derivatives vanish, then your equilibrium is stable. $U^{\mathrm{IV}}(a) < 0$ is unstable, and $U^{\mathrm{IV}}(a) = 0$ is inconclusive (see next higher derivative).
Do you see the pattern? The character of an equilibrium point is fixed by the first non-vanishing derivative higher than first. If that derivative is even, then you use the positive/negative distinction for stable/unstable. If that derivative is odd, then you have a meta-stable point.
All of this gets tremendously complicated by linear algebra when you go multi-dimensional - you would need to deal with the equivalent of eigenvalues for tensors with ranks higher than 2 (I confess, I've never worked out the details).
The algorithm outlined above does have its limitations, though. Consider the function $e^{-x^{-2}}$ near the point $x=0$ (if we plug the hole there). Is that a stable equilibrium? If you graph the function, it certainly looks like it. If you start doing derivative tests, though, you'll run into the problem that all of the functions derivatives vanish there! Handling cases like this would require getting in to a more technical definition of how to characterize the local behavior of a function (involving sets, epsilons, and "there exists" type statements).