The 20-year-old Frenchman joined the Saints from French club Rennes in 2015 and made his first-team debut in November.
He has become a regular starter under new coach Ralph Hasenhuttl at a club who have lost a number of high-profile young players to Premier League rivals in recent years.
"This manager has given me all of his trust, so I am just happy to sign again," Valery said in a club statement.
"And I can't wait now to give everything I've got to help the club stay in the Premier League and to keep working hard and improve my game and be a better player than I am now."
News that makes sense
Your trusted source for staying up-to-date with the world around you. Get free daily news updates and analysis, straight to your inbox.
Valery scored his first senior goal against Manchester United this month and netted another in Saturday’s 2-1 win over Tottenham Hotspur.
"Yan’s development has been fantastic in the last few months," Hasenhuttl said. "I think he is a player who embodies precisely the philosophy of Southampton, as he is young and forward-thinking.
"He has been given trust by us, and in return he has shown exactly what we want to see, which is a brave player who believes in himself."
(Reporting by Andrew Downie, editing by Ed Osmond)
