The Spaniard, who left Stamford Bridge following his six-month spell as interim manager, will take charge at the Stadio San Paolo this summer.
"I am very happy and very satisfied for having committed to a great club with an illustrious heritage like Napoli," Benitez said on his official website.
"I understand the history of the city and how the club forms a fundamental part of the culture and traditions of Naples. I must confess that I am extremely excited because I can share my passion for football with the fans of Napoli; it is proven that they are very, very special.
"I look forward to experiencing each and every one of the fans of Napoli and
their strong support for this project that we will begin. I'm happy to become a member of that great family of Naples and thus we can share the triumphs together. We will begin from the start as we mean to go on and we will fight from the beginning to achieve success for the fans of SSC Napoli."
Napoli president Aurelio De Laurentiis on Monday evening tweeted a picture of him shaking hands with Benitez on his verified Twitter account, and wrote: "Rafa Benitez is the new coach of Napoli. A great man with international experience. A leader."
And Napoli later confirmed the appointment on their official website, with a statement reading: "Rafa Benitez is the new coach of Napoli. The agreement was signed today in London.
"SSC Napoli is happy to welcome a coach so prestigious in their own family. A welcome also to his collaborators."
Benitez confirmed that fitness coach Francisco de Miguel Moreno and goalkeeping coach Vicente Javier Valero Berchili, who were both part of his
backroom team at Liverpool, Inter Milan and Chelsea will join him once again.
Benitez quickly emerged as the favourite to replace Mazzarri, who resigned from the Serie A runners-up last Sunday night and was confirmed as the new Inter Milan coach on Friday.
He led Chelsea to Europa League glory and a third-placed finish in the Premier League this season after replacing Roberto Di Matteo in November.
The Spaniard won the Champions League while at Liverpool in 2005 and this month's Europa League triumph was his second win in the competition after he won it with Valencia in 2004 before moving to Anfield.
The 53-year-old also won the Primera Division twice with Los Che and has won the English and Italian domestic cups with the Reds and Inter Milan.
He moved to the San Siro the summer of 2010 after Jose Mourinho had guided Inter to the Champions League and he also has some big boots to fill in Naples.
Mazzarri guided Napoli to the Coppa Italia in 2012 and their second-placed finish this term in Serie A is their best league finish since they won the Scudetto in 1990.
Benitez's first job will be attempting to keep hold of star player Edinson Cavani who has been heavily linked with a move away from Italy this summer.