Ten Hag will leave his role as Ajax head coach after the end of this season and join the English club.
German coach Ralf Rangnick will continue to be the caretaker manager of the English club until the end of the current season.
"During the past four years at Ajax, Erik has proved himself to be one of the most exciting and successful coaches in Europe, renowned for his team's attractive, attacking football and commitment to youth," Manchester United Football Director John Murtough said.
"We wish Erik the best of luck as he focuses on achieving a successful end to the season at Ajax and look forward to welcoming him to Manchester United this summer," he added.
Ten Hag said: "It is a great honor to be appointed manager of Manchester United and I am hugely excited by the challenge ahead."
The 52-year-old manager won two Dutch Premier League (Eredivisie) titles with Ajax in 2019 and 2021.
Manchester United, who are 23 points behind leaders Manchester City, placed sixth with 54 points in the English Premier League standings after their heavy 4-0 defeat to Liverpool on Tuesday.