Ten Hag will leave his current position at the end of the season and take over from Ralph Rangnick at Old Trafford.
Ten Hag will be Manchester United's fifth permanent manager since Sir Alex Ferguson's retirement in 2013.
The Dutchman had been in charge of Ajax since 2017, winning the Eredivisie twice and reaching the Champions League semi-finals in the 2018/2019 season.
Ten Hag can add another Eredivisie title to his list of honours before leaving as Ajax are four points clear of PSV Eindhoven with five games still to play.
The 52-year-old has told the Red Devils' official website: “It is a great honour to be appointed manager of Manchester United and I am hugely excited by the challenge ahead. I know the history of this great club and the passion of the fans, and I am absolutely determined to develop a team capable of delivering the success they deserve.
“It will be difficult to leave Ajax after these incredible years, and I can assure our fans of my complete commitment and focus on bringing this season to a successful conclusion before I move to Manchester United.”
United's football director, John Murtough, added: “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.
“In our conversations with Erik leading up to this appointment, we were deeply impressed with his long-term vision for returning Manchester United to the level we want to be competing at, and his drive and determination to achieve that.
“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.”