After almost two months of speculation and negotiation, Madrid and Spurs both announced the transfer on Sunday evening.
Journalists understand Real have paid 100 million euros (£85.3million) for Bale's signature.
Madrid announced on their website: "Real Madrid and Tottenham Hotspur have reached an agreement for the transfer of Gareth Bale, who will be contracted to the club for the next six seasons."
The deal is subject to Bale passing a medical with the nine-time European champions, with all other details resolved.
Real say the 24-year-old will be presented as their new player at the Bernabeu on Monday at noon UK time.
Spurs had been in talks with Real for much of the summer and did not field him for the 1-0 north London derby loss against Arsenal earlier on Saturday.
Speaking after his side lost 1-0 to Arsenal at the Emirates Stadium, manager Andre Villas-Boas said of Bale: "He is going to join Real Madrid so we wish him all the best.
"He is an absolutely wonderful player.
"He has left us with some great memories from last season which every Tottenham fan cherishes, but he has moved on and we will move on as well."
Spurs had initially resisted Real's advances, but chairman Daniel Levy explained he had no option but to let the Welshman go after the player's head was turned.
"Gareth was a player we had absolutely no intention of selling as we look to build for the future," Levy told Tottenham's website.
"He is a player whose career we have fostered and developed and he was only a year into his new four-year contract.
"Such has been the attention from Real Madrid and so great is Gareth's desire to join them, that we have taken the view that the player will not be sufficiently committed to our campaign in the current season.
"We have, therefore, with great reluctance, agreed to this sale and do so in the knowledge that we have an exceptionally strong squad to which we have added no fewer than seven top internationals. More importantly, we have an immense team spirit and a dressing room that is hungry for success.
"We wish Gareth all the best in the future and he shall always be welcome at (White Hart) Lane."
Bale thanked Tottenham for making his dream world-record move to Real Madrid happen after the deal was finally agreed on Sunday night.
The 24-year-old, who scored 31 goals for club and country last term, admits he could not afford to turn down the chance of playing for the nine-time European champions.
"I have had six very happy years at Tottenham but it's the right time to say goodbye," Bale told Tottenham's website.
"We've had some special times together over the years and I've loved every minute of it.
"I would like to thank everyone at the club, the chairman, board, staff, coaches and players - and most of all the fantastic fans who I hope will understand this amazing career opportunity.
"I am not sure there is ever a good time to leave a club where I felt settled and was playing the best football of my career to date.
"I know many players talk of their desire to join the club of their boyhood dreams, but I can honestly say, this is my dream come true.
"I am well aware that I would not be at the level I am today were it not for firstly Southampton and then Spurs standing by me during some of the tougher times and affording me the environment and support they have.
"Tottenham will always be in my heart and I'm sure that this season will be a successful one for them. I am now looking forward to the next exciting chapter in my life, playing football for Real Madrid."
Bale joins a long list of illustrious players to have made big-money moves to the Bernabeu.
Luis Figo, Zinedine Zidane, David Beckham and Cristiano Ronaldo have all been given the 'Galactico' moniker following their high-profile transfers to Real, but none of them have cost as much as Bale.
Bale alerted the top clubs in Europe to his potential in the 2010-11 season with a couple of stunning performances for Spurs against Inter Milan in the Champions League.
Despite interest from Inter, Bale signed a new deal with Tottenham in November 2011 and following another successful season, he was rewarded with an improved contract in the summer of 2012.
But it was only last season that Bale underlined his status as one of the best footballers on the planet.
New manager Andre Villas-Boas shifted Bale from the left flank into the centre and the move paid off as he enjoyed comfortably the best season of his career, finding the net 31 times for club and country.
Seven years ago, when a skinny and lanky Bale joined Spurs from Southampton for £6million, it would have been unthinkable that the player would one day end up becoming one of the best in the world.
Indeed, for a while it seemed like Bale was a curse to the north London club as he played in a record 24 league matches for Spurs without being on the winning side.
But after being named player of the season in England last year, it was clear that Tottenham's failure to qualify for the Champions League meant Bale's time at Spurs was up.
To Levy's credit, he has spent the money from Bale's departure in advance, with Roberto Soldado, Erik Lamela, Paulinho, Etienne Capoue, Christian Eriksen and Vlad Chiriches all joining Tottenham in a huge summer spending spree.