Vinicius has made 235 appearances and scored 63 goals for Real Madrid since joining from Flamengo in the summer of 2018.
The Brazil international has won nine trophies with Los Blancos, including the Champions League and two La Liga titles.
"Real Madrid C. F. and Vini Jr. have reached an agreement to extend the player's contract, linking him to the club until 30 June 2027," an announcement on the Real Madrid website read.
"Aged 23, Vini Jr. is already one of Real Madrid's most influential players of recent years.
"He scored the goal that clinched the 14th European Cup in the final in Paris in 2022 and was awarded the Golden Ball at the 2022 Club World Cup in Morocco, which Real Madrid won, making it the eighth world trophy in our history."
Vinicius added on X: "Hello Madrid fans, I am very happy to renew my contract. It is a dream for me."
"I hope I can continue here for many years, scoring many goals and winning many titles. Thank you very much for the love. Hala Madrid!"
On Monday, Vinicius won the Socrates award during the Ballon D'or ceremony for his fight against racism.