When an object or a body is brought in contact with another body with different temperatures, then the heat gets transferred from high temperature object to low temperature object, till both the bodies attain thermal equilibrium. When the objects are in thermal equillibrium, all the objects attain same temperature and there is no heat flow between them.
For example, when a hot cup of tea is kept under room temperature, then the heat gets transferred to the atmosphere with respect to time, till the temperature of tea and atmosphere is equal.