Kubo, who moves from Tokyo for a reported €2million fee, made his J.League debut at the age of just 15.
The 18-year-old, who is considered one of Asia's most exciting young talents, made his full Japan debut this month and is in their squad for the Copa America.
Kubo will play for Madrid's reserve team Castilla next term and becomes their latest signing ahead of the 2019-20 season.
Following an underwhelming campaign, Zinedine Zidane's squad has been boosted by the arrivals of Eden Hazard, Ferland Mendy, Luka Jovic, Eder Militao and Rodrygo Goes.
Kubo was previously on the books of Barcelona and was linked with a return to Madrid's LaLiga rivals, with Paris Saint-Germain also said to be interested.
But Madrid have signed the teenager, who was described in a club statement as "one of the most promising young players in world football".