Energy is defined as the ability to do work. Because power is the rate of energy usage, power used over a span of time is actually energy consumption. If power and time are multiplied together, we will get energy.
The joule is defined as a unit of energy. There is another unit of measure which is perhaps more familiar. Because power is expressed in watts and time in seconds, a unit of energy can be called a watt-second (Ws) or more recognizable from the electric bill, a kilowatt-hour (kWh).