This concerns the transfer of heat from the tongue’s saliva, as heat naturally passes from warmer to colder objects. The saliva in the tongue is warmer than the frozen object. This means that when the tongue touches the freezing object, the saliva on it becomes colder as the heat is transferred. Once the saliva on the tongue loses its heat it cannot replace it fast enough to melt the ice, so the saliva freezes, forming new crystal structures with the ice on the frozen surface. As a result, your tongue gets stuck and it can be painful to get free!
Answered by Louise Thomas.