Heat and temperature are a closely related topic, and as such, the difference between the two can be a bit confusing. The core difference is that heat deals with thermal energy, whereas temperature is more concerned with molecular kinetic energy.
Heat describes the transfer of thermal energy between molecules within a system and is measured in Joules. Heat measures how energy moves or flows. An object can gain heat or lose heat, but it cannot have heat. Heat is a measure of change, never a property possessed by an object or system. Therefore, it is classified as a process variable.
Temperature describes the average kinetic energy of molecules within a material or system and is measured in Celsius (°C), Kelvin(K), Fahrenheit (°F), or Rankine (R). It is a measurable physical property of an object—also known as a state variable. Other measurable physical properties include velocity, mass, and density, to name a few.
Heat is a transfer of thermal energy caused by a difference in temperature between molecules.
The second law of thermodynamics is a complex topic that requires intensive study in the field of thermodynamics to truly understand. However, for the purpose of this article, only one small aspect needs to be understood and that is the fact that heat will always flow spontaneously from hotter substances to colder ones. This simple statement explains why an ice cube doesn't form outside on a hot day or why it melts when dropped in a bowl of warm water.
Imagine the aforementioned ice cube dropped into a bowl of warm water—the ice must gain heat (thermal energy) from the water in the bowl (see preceding paragraph). Adding thermal energy leads to an increase in the kinetic energy of the ice molecule, and thus an increase in temperature. This is known because temperature is in fact the measure of the average kinetic energy of the molecules. Furthermore, the ice will continue to gain thermal energy causing its molecules to move faster and eventually break their intermolecular bonds or melt.
In conclusion, the transfer of heat or thermal energy will typically change the temperature of the substance, but not always! For example, at the moment when the ice in the bowl turns to water those water molecules will be at the exact same temperature as when they were ice. In this case, instead of the thermal energy doing work to increase the kinetic energy, it does work to break the intermolecular bonds, causing a change of state. However, as time goes on the temperature of the recently melted ice will increase until everything within the bowl reaches equilibrium—meaning a consistent temperature throughout.