This question is a bit difficult intuitively, considering that we want to think that potential energy must always be greater than zero! In fact, considering that generally, total energy is the sum of potential and kinetic energies, it is difficult to conceive of a situation where the "true" potential energy of an object is less than zero. Granted, any object with mass has mass energy, per Einstein, and mass energy could be construed as potential energy, so a negative overall potential energy is difficult to conceive of conceptually.
It is easy, however, to use mathematical tricks to get a negative potential energy. First, you must consider that potential energy is determined by an arbitrary coordinate system. So, if I have an object at rest on my desk (like my cup of coffee), but the origin of my coordinate system is at the ceiling of the room, my coffee would have a negative potential energy! This relation is simple:
`P.E. = mgh`
We just had an example where `h` is negative. The `m` term is always positive, and depending on your coordinate system, `g` may be positive as well. Thus, we have a negative potential energy. Of course, you can flip the situation if `g` is negative for the same result.
Remember, the potential energy of an object at different points is not a true physical entity, and a potential energy on its own is not meaningful. It only describes the potential for an object to move relative to its environment. The only thing that matters is the potential energy difference!