The reigning Ballon d'Or winner equalised for Madrid with a well-placed header on 76 minutes before scoring both with his left and right foot in extra time as his side advanced to the Champions League semi-finals.
It means Ronaldo has five goals over the course of the quarter-final tie having netted a brace in the 2-1 first-leg victory in Munich.
Tuesday's perfect hat-trick was incredibly his 41st in just eight seasons at the Bernabeu since signing from Manchester United in 2009.
Ronaldo's first hat-trick came back in May 2010 against Mallorca in La Liga - the competition where the bulk of his trebles have come.
The 32-year-old's hat-trick against Bayern was his sixth in the Champions League - he has netted two in the Copa Del Rey and one in the Club World Cup.
That Club World Cup hat-trick took Ronaldo to a landmark of 40 trebles against Japanese outfit Kashima Antlers in December - clawing his side back from 2-1 down to a 4-2 victory as they won the Club World Cup.
And his 41st treble was again crucial for his team on Tuesday, as Madrid were taken to extra time when ten-man Bayern netted late on through Sergio Ramos's own goal to make it 3-3 on aggregate.
Ronaldo's second and third goals saw Madrid to the finish line but the strikes were marred in controversy as he appeared a yard offside for both - Marco Asensio netted a late fourth.
The 41st hat-trick is just the latest astounding statistic from another remarkable season for the goal-machine.
Having netted his 100th European goal with his first-leg double against Bayern last week, Tuesday night's hat-trick meant he had scored a century of goals in the Champions League alone.
He is the leading scorer in the competition's history and became the all-time assist leader with 31 during this season's last-16 tie against Napoli.
Ronaldo additionally reached a landmark in goalscoring for Portugal this campaign when his double against Hungary took him to 70 international goals.
Despite netting 118 times during his Manchester United career, Ronaldo only recorded one hat-trick during his time at Old Trafford - in a 6-0 win over Newcastle in January 2008.
To highlight his goalscoring prowess Ronaldo has the most hat-tricks in La Liga history (32) despite having played in Spain for just eight seasons and is tied with Lionel Messi for the most in one season with eight, in 2014-15.
Ronaldo has now scored 395 times in 386 outings for Madrid and has 518 goals in 711 club appearances in total.
|Cristiano Ronaldo poses with his glass cabinet of match balls earned from his hat-tricks|
Real Madrid v Bayern Munich: Carlo Ancelotti says referee 'not up to task'
Bayern Munich manager Carlo Ancelotti said referee Viktor Kassai "wasn't up to the task" of a Champions League quarter-final and called for video technology "as soon as possible".
Bayern midfielder Arturo Vidal was sent off for two bookable offences, while Real Madrid's Cristiano Ronaldo scored in extra time from an offside position as the Spanish holders won 6-3 on aggregate on Tuesday.
"We had thought of everything going into this game - except the referee," Ancelotti said.
"You can't decide a semi-final spot like this. It shouldn't happen at this level."
Ancelotti said Real manager Zinedine Zidane agreed with his assessment of Hungarian referee Kassai's "negative" performance at the Bernabeu.
"The referee probably wasn't up to the task," said the Italian, a former Real boss.
"I don't think Real Madrid have any influence on referees. The officials simply got it wrong. I had never been in favour of video technology, but I must admit it's necessary now."
Goalline technology - to determine whether the ball has crossed the line - was brought into the Premier League for the start of the 2013-14 season and the Bundesliga from 2015-16.
Video assistant referees (VARs) are being trialled worldwide, with Fifa president Gianni Infantino keen to employ the system at the 2018 World Cup in Russia.
VARs - which rule on key incidents concerning goals, red cards, mistaken identities and penalties - could be used in English football as early as August, with the EFL Cup first round touted as a possible initial testing bed for the technology.
Video has already been used at international level, with two wrong decisions corrected by VARs as Spain beat France in a friendly in Paris on 29 March.
Uefa has not committed to the trials but in a statement said it was "constantly looking at ways in which it can improve the matches taking place in its competitions".
It added: "Regarding video assistant referees, there are currently trials taking place, so let's see the results and if or how the system can work while preserving the flow of the game."
'The referee killed it' - reaction
BBC 5 live pundit Pat Nevin: "I don't want the referee to have spoiled the entirety of this game because it was a fantastic tie over two legs - but the referee killed it with the sending off.
"It was terrible, and then he gets the decision wrong for Ronaldo's goal.
"The referee will probably get as much chat as anyone else."
Bayern chairman Karl-Heinz Rummenigge: "It was an extremely emotional spectacle, you can only compliment both teams. Our team has given everything, we must not forget that.
"It was great football, but unfortunately the referee gave some extreme decisions at our expense. The referee was of course the killer."