Consider any two bodies of different temperatures. One has a high temperature and another has a lower temperature than the first one.
When both come in thermal contact their temperature tries to achieve equilibrium
According to the principle of calorimetry, the heat released by the higher temperature body is equal to the heat gained by the lower temperature.
Hence, the principle of calorimetry states that the heat released by the higher-temperature body is equal to the heat gained by the lower-temperature body.