If two bodies at different temperatures are brought in thermal contact (thermal contact means if the heat can exchange between them; they may be in physical contact with one another or not), heat energy transfers from hotter to the colder body. This happens spontaneously until both have the same temperature. When the bodies have the same temperature, they are said to be in thermal equilibrium.
Note that thermal equilibrium does not mean the flow of heat has stopped. In fact, at thermal equilibrium, flow of heat from the first body to the second is equal to the flow of heat from the second body to the first one. We can then say there is no net heat flow between the bodies.
Pingback:Theory of Thermodynamics – msa