When an object is at a certain height, it has some energy stored in it as we have done some work on it to get it to that height. So when it already has energy, then why doesn't it fall off from the table top onto the ground by itself? Why does it need a slope or a push to fall down the edge? Where does the stored energy stay in the object, and why does it only convert into vertical motion and not horizontal motion?
[Physics] Why doesn’t an object, despite having a non-zero potential energy stored in it, fall by itself from the elevation
equilibriumfrictionnewtonian-mechanicspotential energystability
Related Solutions
To understand your situation, you need to rethink your understanding of the definition of the potential energy. The best definition for the potential energy is: Potential energy is a measure of work done by a potential force upon the object moving while it is experiencing that force. The change in the potential energy of a body between two positions is equal to work of the potential force upon movement of the body between those two positions. So, when you specify Potential energy of the body, it is always the energy of a specific [conservative!] force (or a combination of conservative forces), and with respect to some point of reference that you choose as a zero level of that potential energy. (Note that the position is also with respect to the other body that produces the force.)
When you have a single solid body, i.e. there are no external forces acting on it, you do not have any potential energy defined. So, the answer to your question: in case of a single solid body the potential energy is undefined. Saying that something that is undefined is zero is not strictly correct.
The case is rather different when the body is not solid, i.e. when its shape is not constant. E.g. if the shape of an elastic body can be changed (e.g. the body can be compressed), - then you have a potential energy related to that deformation. In that case, you can consider the body as a combination of different parts ("points" of very small mass) of it that are acting on each other with forces. If the object is fully elastic, each of those forces is potential, and then you can associate potential energy with each of them. Accounting for all of them individually is rather difficult, so, an average potential energy for the entire ensemble of these portions (points) is introduced. In this, fully elastic case, this potential energy is a unique function of the shape of the body (i.e. of the relative positions of all the points within that body).
Some other typical examples where the confusion similar to the OP's occurs is the potential energy of a charged particle (e.g. electron) in an electric field. It looks like there is no other "body". In reality, there is a field (electric), which effectively is the representation of another body(ies) acting on this charged particle. Note that in case of gravity, one can define a gravitational field, thus "hiding" the object that creates it.
Where we define the potential energy to be $0$ in classical mechanics is arbitrary. All that matters is the change in potential energy. Since you are just learning this stuff I will assume you are in an algebra based physics class, so I will avoid using calculus here.
Potential energies are nice because they tell us how much work is done by a conservative force. More specifically, the work done by a conservative force is given by $$W_{cons}=-\Delta U$$ where $U$ is the potential energy associated with that conservative force. This is useful because we also know that the net work done on an object determines its change in kinetic energy $$W_{net}=\Delta K$$
So, if we consider your case where we just have one conservative force acting on the object, we can conclude that $$\Delta K=-\Delta U$$
And so we see here that the only thing that determines how the motion of our object changes is just the change in potential energy. If we define the zero-point to be at the top of the cliff, then as the object falls its kinetic energy will grow and its potential energy will decrease and be negative when it hits the bottom of the cliff. If we define the zero-point to be at the bottom of the cliff then as the object falls its kinetic energy will grow and its potential energy will decrease to $0$ when it hits the bottom of the cliff. In either case the same thing happens because we have the same change in potential energy.
Also another question that was already discussed in SE (but i didn't find my answer there) is why do we talk about the potential energy of a system (ball+Earth) but kinetic energy of an object (ball)?
Typically in introductory physics classes we just consider the ball being in a uniform gravitational field and we don't even consider the Earth. However if you want to include the Earth in your system then when the ball falls the Earth will actually move slightly upwards to meet the ball. It will still be the case though that the work done by gravity on each object is related to the change in the potential energy of each object, which results in a change of kinetic energy.
Best Answer
It is wrong to think potential energy is stored in the object. The earth pulls the object down, but the object pulls the earth up. They share the potential energy.
The object fails to fall down because the tabletop pushes it up.
The earth fails to fall up because the bottom of the table legs push the earth down.
The table pushes up and down because it is squished a bit and squished things push outwards a bit. So for a moment the object did go down and the earth did go up, but as they moved closer the table got squished and so they moved less and less. They stopped when the table was squished enough to counter the gravitational forces.
Why did I bring that all up? Because your focus on just one object is simply a bias. If you had two equally sized objects and you thought each had the potential energy then you'd get the wrong answer by a factor of two.
Since the earth is so much more massive, and the object and earth gain equal and opposite amounts of momentum, the earth gets way less kinetic energy as they move towards each other. So almost all of the change in potential energy is given to the object as kinetic energy, but only because the object it is so much much smaller.
The potential energy belongs to the system, and it gets shares between the parts when it changes. For gravity it changes when the positions change, so they have to move to release energy to divide up.
And neither can move because that pesky table is in the way. Otherwise they indeed would fall towards each other.
If you wanted the object to move sidewise to fall off the table it needs some sidewise velocity, so it either has to start with that velocity or you need a sidewise force. And gravity attracts, so doesn't point sidewise.