The midfielder will join Real Madrid Castilla, the club’s reserve team.
Kubo, 18, is on duty at the Copa America with Japan, for whom he made his international debut on 9 June against El Salvador.
Madrid will pay 2m euros (£1.78m) to Japanese top-flight side FC Tokyo for the player, reports Marca.
Kubo was on Barcelona’s books from the ages of nine to 13 but had to return home when the Spanish club were found guilty of youth transfer breaches and given a transfer ban.
Madrid are reported to have offered the teenager a five-year contract worth 1m euros (£890,000) a year.
They described Kubo as “an attacking midfielder with excellent technique and great vision for the game”.
He has played 13 times for FC Tokyo in 2019, scoring four goals.