The former Italy forward, 52, replaces Mircea Lucescu who was sacked last week after one season in charge.
Zenit finished third in the Russian Premier League club and missed out on Champions League qualification.
Mancini, who won the Premier League title with Manchester City in 2012, most recently managed Inter Milan.
The Italian, who left Inter by mutual agreement in 2016, has the option of extending his contract at Zenit for a further two years.
Russia's Zenit St Petersburg have appointed ex-Manchester City manager Roberto Mancini as their new head coach on an initial three-year contract.