Mattei was born in Bologna, then part of the Papal States, to a family of artisans. At the local Church of St. Francis, he became a pupil of the famed musician, Friar Giovanni Battista Martini, O.F.M. Conv., a member of the Franciscan community attached to the church. He also followed Martini's example and entered the Conventual Franciscans. Following his period of novitiate, he was named his mentor's assistant and substitute conductor of the famed girls choir at the church and succeeded him in that position upon his death in 1784.
Mattei continued as choir director at the Church of St. Francis until 1809. He then moved briefly to Padua, where he served in that function for the Basilica of Saint Anthony of Padua, operated by his religious Order. This situation was temporary, however as he soon returned to Bologna, where he became the music director at the Church of St. Petronius.
During the occupation of Italy by the French Revolutionary Army, the friary was suppressed and the community of friars scattered. Mattei then went to live with his mother, supporting himself by giving private instruction.
Mattei's music bears a close resemblance to the style of composition of Martini, his mentor.
Mattei himself composed over 300 works of sacred music, a body of work which remains largely unpublished. He also composed some secular vocal pieces and symphonies. In 1804 he was appointed as a professor at the Liceo Musicale di Bologna (now the Conservatorio Giovanni Battista Martini), where he had among his pupils Gaetano Donizetti, Yevstigney Fomin, Angelo Mariani, Francesco Morlacchi, Luigi Felice Rossi, Gioachino Rossini, Giovanni Tadolini, and Christian Theodor Weinlig. See: List of music students by teacher: K to M#Stanislao Mattei.
- Oratorio - La passione di Gesù Cristo 1792