The decision to select the hosting venue was taken at the UEFA Executive Committee meeting in Prague.
The stadium, which was built in 1999 for the Rugby World Cup, will host the event at the end of the 2016-17 season, with the 2016 final being held at Milan’s San Siro stadium.
UEFA has also confirmed that the Friends Arena in Stockholm will host the 2017 Europa League final and that the Philip II Arena in the Macedonian capital Skopje will host the Super Cup.
It is the first time that a Welsh city will host the Champions League final, although Real Madrid did beat Sevilla 2-0 in last year’s UEFA Super Cup at Cardiff City Stadium.
The stadium also hosted the FA Cup final for a six-year spell from 2001 to 2006 during Wembley’s redevelopment.
Wales stars Gareth Bale and Aaron Ramsey were quick to welcome the news.
Real Madrid star Bale said: “These are exciting times for Welsh football,” Bale, who won the Super Cup in Cardiff last year, said.
“It feels like the whole country is behind us as we attempt to reach next year’s UEFA Euro 2016 finals in France.
“I know how passionate the Welsh football fans are so it’s great the UEFA Champions League Final is coming to my home city of Cardiff.
“I loved playing in the UEFA Super Cup last year and it would be fantastic to be involved in front of a packed crowd at such an iconic stadium in 2017.”
Arsenal midfielder Ramsey tweeted: “The Millennium Stadium is a fantastic stadium. It’ll be a brilliant occasion.”
“We went to Cardiff for the Super Cup last year – the Cardiff City Stadium for Real Madrid against Sevilla,” UEFA general secretary Gianni Infantino said.
“Cardiff is certainly a beautiful city but, more importantly, the Millennium Stadium in Cardiff is one of the few stadiums who can host a Champions League final. It has become such a big event.
“We can’t go every year to Wembley or to Berlin or whatever, we need to rotate a little bit the European associations.
“It is only deserved that a city like Cardiff and such a historic association of UEFA, the Welsh Football Association, can host the most prestigious club event.
“We’re all very looking forward to Cardiff. The stadium has shown it can host big events in the past with the Welsh FA and we are in good contact already.
“I think it is well deserved and we’re very much look forward to it.”
Football Association of Wales chief executive Jonathan Ford said: “Staging major football finals is one of the objectives contained within the FAW’s Strategic Plan – we believe that staging both the 2017 UEFA Champions League Final and 2017 UEFA Women’s Champions League Final will have a positive and long-lasting effect on Welsh football.
“Today’s announcement is the culmination of two years’ of hard work and I’d like to thank all those who’ve helped the FAW fulfil its ambition of staging a UEFA Champions League Final.”
Football Association of Wales president Trefor Lloyd Hughes said: “The FAW is grateful to UEFA’s Executive Committee for giving the FAW and Wales the opportunity to stage one of the world’s biggest sporting events.
“Welsh football is certainly on the up and we look forward to working closely with UEFA and all of our stakeholders over the next two years to deliver two memorable finals.”