The former Germany international's new deal will see him mark ten years in the Spanish capital.
Kroos' previous deal would have expired at the end of this month.
The 33-year-old has made 417 appearances and scored 27 goals since joining Real Madrid from Bayern Munich in the summer of 2014, winning a host of laurels.
A statement from the 14-time European champions read: "Real Madrid C. F. and Toni Kroos have agreed to extend the player's contract, which will see him contracted to the club until 30 June 2024.
"Toni Kroos joined Real Madrid in 2014 and is the German player to have worn the club's jersey the most times, having made 417 appearances.
"Over his nine seasons as a Real Madrid player, he has won 20 trophies: 4 Champions League, 5 Club World Cups, 4 European Super Cups, 3 LaLiga titles, 1 Copa del Rey and 3 Spanish Super Cups."
Kroos will have added competition in midfield next season after Real Madrid signed England international Jude Bellingham from Borussia Dortmund for €103m.
Kroos was a key part of the Germany side that won the 2014 FIFA World Cup in Brazil.