The three-times World Player of the Year, who retired two weeks ago at 34, will take part in the friendly against Romania at Sao Paulo's Pacaembu stadium on June 7, the CBF said.
Ronaldo has not played for Brazil since the quarter-final defeat by France at the 2006 World Cup.
"Ronaldo deserves a farewell match, and the Brazilian fans deserve to see him for the last time, wearing the Brazil shirt in a stadium in this country," CBF president Ricardo Teixeira said. "I'm sure it will be worthy of this great player."
Brazil will also play Netherlands in a friendly three days before the Romania game.
Ronaldo is the all-time leading scorer in World Cup tournaments with a total of 15 - four in 1998, eight in 2002 and three in 2006 - and was voted FIFA's World Player of the year in 1996, 1997 and 2002.
He won the World Cup in 1994 and 2002, although he was an unused squad member in the 1994 campaign when he was just 17-years-old. He also helped fire Brazil to the final in 1998.
The former Cruzeiro, PSV Eindhoven, Barcelona, Inter Milan, Real Madrid, AC Milan and Corinthians player also won two Copa America titles in 1997 and 1999, despite suffering three serious knee injuries in his career.
Get the best features, fun and footballing frolics straight to your inbox every week.
Thank you for signing up to Four Four Two. You will receive a verification email shortly.
There was a problem. Please refresh the page and try again.