Lift a book onto a shelf and you have stored energy in it: let it fall and that energy turns into motion. Energy stored by height is gravitational potential energy, one of the stored forms of energy. It depends on the weight $mg$ and on the height.
Key idea
$$\text{PE} = m\,g\,h$$ where $h$ is the height above a level you choose as zero, and $g = 9.8\,\mathrm{N/kg}$. Only changes in PE matter, so pick one zero level and keep it for the whole problem.
Why it works
To lift an object at a steady speed, you push up with a force equal to its weight, $mg$, through the height $h$. That takes $mg \times h$ of energy, and it is stored as PE. Measuring heights from the floor or from a table gives different PE values, but the same difference between two heights, and differences are what turn into motion.
Worked example: Lift a box
A 4 kg box is lifted from the floor onto a shelf 1.5 m high. How much potential energy does it gain?
- $\text{PE} = m\,g\,h = 4 \times 9.8 \times 1.5$.
- $= 58.8$ J.
Answer: 58.8 J
Worked example: Same change, any zero
A 2 kg book moves from a 0.8 m table to a 2.0 m shelf. Find the change in PE using the floor as zero, then using the table as zero.
- Floor as zero: $2 \times 9.8 \times 2.0 - 2 \times 9.8 \times 0.8 = 39.2 - 15.68 = 23.52$ J.
- Table as zero: the shelf is $1.2$ m up and the table is at 0, so $2 \times 9.8 \times 1.2 - 0 = 23.52$ J.
- Same change either way.
Answer: 23.52 J both ways
Common mistake
Switching zero levels partway through, for example measuring one height from the floor and another from the table. Mixing them gives a wrong change. Check: write down your zero level first, and measure every height from it.