Back in the early 19th century, a British brewer and physicist named James Joule demonstrated that heat and mechanical work were two forms of the same thing: energy. His discovery earned him a lasting place in science history; today, the unit in which energy and heat are measured is named after him. Calculating the amount of heat absorbed or released by an object is fairly straightforward as long as you know three things: its mass, the change in its temperature, and the type of material it's made from.
Look up the specific heat capacity of your material. The first link under the resources section lists the specific heat capacities of common solids; the second link lists the heat capacities of common liquids. Use the value under the column with units of kJ/kg K. Note that kJ stands for kilojoule, one thousand joules, while kg is a kilogram, a unit of mass, and K is Kelvin, a unit of temperature. One degree Kelvin is equal to one degree Centigrade.
Subtract the starting temperature of your object from its final temperature to find the change in temperature. If your change in temperature is in Fahrenheit, convert it to degrees Kelvin by using the following formula:
(Temperature in Fahrenheit - 32) x 5/9 = temperature in Celsius
Multiply the change in temperature by the specific heat capacity and the mass of your object. This will give you the heat lost or gained in joules.
Example: If 10 kilograms of water are heated from 10 degrees Celsius to 50 degrees Celsius, how much energy (in joules) did they absorb?
Answer: The specific heat capacity of water is (roughly) 4.184 kilojoules / kg K.
(10 kg) x (40 degrees Celsius temperature change) x (4.184 kJ / kg K) = 1673.6 kilojoules.