The 31-year-old is now one behind Barcelona’s Messi, who took the honour for a fifth time last year.
Atletico Madrid’s French forward Antoine Griezmann finished third in the vote.
Ronaldo helped Real Madrid win last season’s Champions League and scored three goals as Portugal won Euro 2016.
He has now won the Ballon d’Or in 2008, 2013, 2014 and 2016, with Messi the only other recipient of the award since winning it for the first time in 2009.
“I never thought in my mind that I would win the Golden Ball four times. I am pleased. I feel so proud and happy,” said Ronaldo.
“I have the opportunity to thank all of my team-mates, the national team, Real Madrid, all of the people and players who helped me to win this individual award.”
The former Manchester United forward has scored 19 goals in 20 games for club and country this term, to add to the 54 he got last season.
Ronaldo’s Real Madrid team-mate Gareth Bale finished sixth in the vote, while Leicester City striker Jamie Vardy – the only Englishman included on the 30-player shortlist – was eighth.
The Ballon d’Or is voted for by 173 journalists from around the world.
It has been awarded by France Football every year since 1956, but for the past six years it became the Fifa Ballon d’Or in association with world football’s governing body and was awarded to the world’s best player.
However, Fifa ended its association with the award in September.
Fifa will hand out its own prize for the world’s best men’s player, along with the best women’s player and team of the year, at the Best Fifa Football Awards ceremony in Zurich on 9 January.
Previous Ballon d’Or winners
2016: Cristiano Ronaldo 2009: Lionel Messi
2015: Lionel Messi 2008: Cristiano Ronaldo
2014: Cristiano Ronaldo 2007: Kaka
2013: Cristiano Ronaldo 2006: Fabio Cannavaro
2012: Lionel Messi 2005: Ronaldinho
2011: Lionel Messi 2004: Andriy Shevchenko
2010: Lionel Messi 2003: Pavel Nedved