electrical energy
Energy is the total amount of work done, while power is the rate of doing it. The difference is like distance versus speed: a car at 60 km/h has a speed, but how far it goes depends on how long it drives. A 10 W bulb left on all night uses far more energy than a 100 W bulb flashed for one second, even though the 100 W is more powerful. Energy is power multiplied by time.
The scientific unit of energy is the joule (J): one joule is one watt for one second, so E = P times t. A 5 W LED running for 10 seconds uses 5 times 10 = 50 J. Because joules are tiny for everyday use, your electricity bill uses the kilowatt-hour (kWh), one kilowatt for one hour, which is 3.6 million joules. A battery's stash is often quoted in milliamp-hours (mAh); multiply by the voltage to get energy, so a 2000 mAh, 3.7 V cell holds about 2 times 3.7 = 7.4 watt-hours.
Energy is what you actually pay for and what a battery actually stores. It decides how long your gadget runs before the battery dies, and how much heat builds up over time inside a sealed box. Designers trade power against time constantly: a sensor that sleeps and wakes only briefly can run for years on one coin cell because, while its power when awake is fine, its energy use over a day is tiny.
A 2000 mAh phone battery at 3.7 V holds about 7.4 Wh; a load drawing 0.5 W would, ignoring losses, run for roughly 7.4/0.5 = about 15 hours.
Battery life is stored energy divided by the power you draw.
People loosely say a battery stores power, but a battery stores energy; power is only the rate at which you draw that energy out.