Pasteurized milk ROTS and goes bad in a couple of weeks or so.
Raw milk usually sours gracefully and can still be used for cooking for a good while longer. The beneficial bacteria from the air, goat's udder region, etc. inoculate raw milk and will grow -- making it more acidic and the environment more conducive to more beneficial bacteria.
People used to "clabber" their milk on the kitchen counter or outside on the steps, letting it gently sour, and did not get ill.
Of course, they didn't live in our modern environments where we regularly kill off both good and bad bacteria. If you want to sour milk, add a starter to it, just in case.
ANSWER: Sweet milk 2-3 weeks maybe. Sour milk -- a month? Maybe more? Kefir or yogurt probably longer.
Dairy sheep and Nubian Goats
"We share half our genome with the banana. This is more evident in some of my acquaintances than others."
-- Sir Robert May, President of the Royal Society of London