“When the offer came from FC Bayern, I didn’t have to think about it for long,” the 20-year-old central midfielder said in a statement.
“FC Bayern are one of the biggest clubs around. I’m coming to Munich to win lots of titles.”
He is Bayern’s second recent signing from the Dutch champions after Morocco right-back Noussair Mazraoui, 24, joined last month on a free transfer.
“Ryan Gravenberch offer a lot to our team,” said Bayern sports director Hasan Salihamidzic.
“He’s one of the biggest talents in Europe, has superb technical ability, always finds solutions in tight spaces, is very dynamic and a goal threat.”
According to reports over the weekend, Bayern will pay Ajax an initial fee of 18.5 million euros ($19.5 million) which could rise by 5.5 million euros in additional payments.
Having joined the Ajax academy as an eight-year-old, Gravenberch was just 16 when he made his first-team debut in 2018.
He has made 10 appearances for the Netherlands having played for junior national teams at each level from Under-15 upwards.