The 21-year-old forward joined the Buddies on  loan in January, scoring twice in 17 appearances, and has now agreed a permanent move.
"I still feel I'm quite young but I feel now at a stage where I need to play every week," Smith told the club's website.
Defender Gary MacKenzie has also agreed a one-year contract extension.
St Mirren, managed by Jack Ross, retained their Championship status thanks to dramatic upturn in form in the second half of the season.
"I think the way that the club is going, particularly the second half of the season, it was an easy decision to make," 31-year-old McKenzie told the club website.
"I wanted to be here, the club wanted me to be here and we just had to brush up on a few things. It was never in any doubt in my mind.
"I believe that we should be looking to get promoted. Simple as that."
St Mirren have completed the signing of Cammy Smith from Aberdeen on a two-year contract.