Energy: E = Pt = VIt
A heater's element is only a resistor, so all the energy it uses becomes heat. In other appliances part of the energy becomes heat because of their resistance and the rest becomes other forms.
Power is the energy used in unit time, so the total energy an appliance uses depends on how long it runs. With P the energy used in unit time, the energy used in time t is Pt.
Energy used
E = Pt
With P in watts (W) and t in seconds (s), E is in joules (J).
Putting VI in place of P:
Energy = potential difference × current × time
E = Pt = VIt