Madrid say the 24-year-old Welsh winger will sign a six-year contract, pending the completion of a medical, and it is believed he will cost them 100m euros (£85.3m).
He will be presented as a Real player at noon UK time on Monday, in front of 80,000 fans at the Club's Bernabeu Stadium.
Bale has released a statement in which he said: "I have had six very happy years at Tottenham but it's the right time to say goodbye.
"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."
Tottenham chairman Daniel Levy said: "Gareth was a player we had absolutely no intention of selling, as we look to build for the future.
"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.
"We wish Gareth all the best in the future and he shall always be welcome at(White Hart) Lane."
Tottenham signed Bale for £10m from Southampton in 2007 but he made little impact initially and was on the verge of being sent out on loan at one point.
However, he thrived once given a more attacking role and was named the PFA Players' Player of the Year for the 2010/11 season.
And he took his game to stunning new heights last season, once again winning the PFA Player of the Year award, as well as the young player of the year gong, after a sensational campaign packed with spectacular goals.
However, Spurs were unable to qualify for the Champions League, which may have been a factor in Bale's desire for a new challenge.
Speaking after Tottenham's 1-0 loss to Arsenal on Sunday, Spurs boss Andre Villas-Boas said of Bale: "The player 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."