If the milk becomes lumpy or gooey after being heated, that's a sign that it's gone bad. Milk curdles because the high acidity in the soured milk causes proteins in the milk to bond together, creating lumps. It's normal for the milk to have a thin skin on top when heated. That doesn't necessarily mean the milk is bad.
Is lumpy milk safe to drink?
Though you shouldn't drink spoiled milk, it's far from useless. If your milk is very old and has started to curdle, become slimy, or grow mold, it's best to throw it out.
Why does my milk have clumps?
Casein, the major protein in milk, is the compound that—suspended in minuscule particles in water— makes milk look white. Acid causes the casein molecules to clump together (curdle), forming soft lumps called curds. ... Milk, by this point, has gone from merely bad to worse. And if you drink it, it can make you sick.