Milk curdles when its acidity causes casein, a major proteins in milk, to be attracted to other casein molecules and clump up, according to About.com. This creates solid masses of fat and protein known as curds, and a translucent fluid with other dissolved proteins known as whey. This occurs either as the result of spoilage after bacteria consume enough milk sugars or deliberately when adding acid to hot milk.
Milk has a natural population of bacteria that pasteurization doesn't completely remove. These bacteria feed on the lactose sugars in milk, releasing lactic acid as a waste product. Once this acid reaches high enough levels, the large casein molecules, which normally have no attraction for one another, gain an attraction and begin to form solid masses. This clumping process happens much more readily at higher temperatures because the molecules move more quickly, making them more likely to encounter one another at these temperatures. Cold milk with high acid levels can remain fully liquid for extended periods of time.
For certain cheeses and other purposes, curdling is done deliberately with fresh milk. This is most often done with either lemon juice or vinegar. The curds created are strained and used for fresh cheeses like ricotta or paneer. Controlled processes similar to curdling are also how yogurt and similar products are created.