When used in chemistry, 'heat' refers to the process of transferring energy between two objects due to a difference in temperature. Heat does not actually refer to the energy of the system.
Temperature is a measure of the average kinetic energy of the atoms or molecules in the system. Higher kinetic energy = Higher Temperature. The temperature of two objects in contact determines the direction of heat transfer.