It is in Sahih Muslim in the section about Doomsday. Narrated by Tirmidhi, the Rasul of Allah (saw) says about the heat of Doomsday:
"On the Day of Judgment the Sun will be drawn near the people until there is only a mile left between them. The sun will melt them, and they will be left in their sweat according to their deeds. Some will be covered in sweat up to his ankles, and some up to their knees some will be covered in sweat up to his waist and some will be bridled with it."