Ranieri replaces Eusebio di Francesco, who was sacked on Monday with the club bottom of Serie A after six defeats in seven matches.
The 67-year-old Italian also succeeded Di Francesco at Roma in March on a contract until the end of last season.
It is his 20th managerial appointment and a ninth spell as a boss in Italy's top flight.
Ranieri was dismissed by Leicester nine months after famously winning the 2016 Premier League title despite beginning the campaign as 5,000-1 outsiders.
Sacked by the Cottagers after only 106 days in charge, Ranieri then took over at Roma, where he began his career as a player.
He guided them to sixth in Serie A last season, finishing three points behind the Champions League places.
Need a VPN? Or seeking to switch? Then support Tribal Football by clicking here to sign up with our official partners NordVPN. Not only will you receive the best VPN experience, but also great discounts by signing up via Tribal Football. Thanks for your support!