Milk, when left for a long time, becomes sour due to Lactobacillus in the milk that converts the lactose in the milk to lactic acid. As the amount of lactic acid in the milk increases, it results in presence of more hydrogen ions and thereby lowering of pH. Due to this milk gets sour after a long time.