The Principle of CALORIMETRY or MIXTURES states that when a hot body comes in contact with a cold body :
The heat lost by the hot body is equal to that gained by the cold body till they achieve a state of thermal equilibrium
When a hot body is brought in contact with a cold body, heat flows from the hotter body to the cooler body till the temperature of the two objects become equal ( Thermal Equilibrium). The heat lost by the hot body is equal to that gained by the cold body, provided no heat is lost to the surroundings. This is in accordance with the law of conservation of energy.