The 54-year-old Italian, who has also managed Sampdoria and Napoli, has signed a three-year contract at Vicarage Road.
Spaniard Flores left after less than a year with the Premier League side.
Watford finished 13th in a season where they also lost in the FA Cup semi-finals to Crystal Palace.
Mazzarri is the Hornets' eighth manager in the past four years.
Watford's chief executive Scott Duxbury told the club's official website: "Walter has been the target of a number of approaches for his services, so we're delighted to secure him as head coach here at Watford.
"We're thoroughly looking forward to working with such a highly regarded coach, with the progress and development of the club always remaining the highest priority."
After the departure of 51-year-old Flores, it soon became clear that Mazzari was the preferred choice of the Pozzo family, who took over at Watford in 2012.
Mazzarri won the Coppa Italia with Napoli in 2012 and took the club to second in Serie A the following season.
He joined Inter on a two-year contract in May 2013 and the club were fifth in his first season.
But he has been out of work since leaving the San Siro in November 2014, having been sacked with the club ninth in the table, 12 points off the top.
Watford have announced that former Inter Milan boss Walter Mazzarri will become head coach from 1 July after the departure of Quique Sanchez Flores.