The former Manchester United defender will replace Giovanni van Bronckhorst, who is leaving at the end of this campaign after four years at the helm of the Rotterdam club.
The 46-year-old Stam has been coaching at PEC Zwolle since the turn of the year.
Ajax extend coach Ten Hag's contract till June 2022
He was previously manager of English club Reading, where he led them to the second-tier Championship playoffs in his first season but was then fired before the end of his second.
Van Bronckhorst, who took the Rotterdam club to their first championship in 18 years in 2017, announced in January he was seeking other challenges when his contract expires.
Ajax win Eredivisie title to secure domestic double
Ten-man Ajax close gap on PSV to just two points