Cows (Bos taurus) were domesticated around 11,000 years ago in the Near East.^1 They were probably initially kept for meat, but it wasn't long before people started milking them too; milk fat residues have been found on pottery in Anatolia that dates to 9,000 years ago.^2 However, initially it's unlikely they drunk milk directly, because until recently almost all humans were lactose intolerant. Instead it would have been made into fermented dairy products like yoghurt and cheese which contain much less lactose. The gene that allows adults to digest lactose can be traced back to Central Europe about 7,500 years ago.^3 It stands to reason that by this point people had started to consume milk directly (perhaps it started as a fall-back energy source for herdsmen), which is why the gene was selected for.
So the answer is somewhere between 11,000 and 7,500 years ago.
Sources: