The deal will carry an annual average value of $775,000 and will begin with the 2023-24 season.
Hofer has played in 22 games with the AHL's Springfield Thunderbirds this season, recording a 10-8-4 record with a 2.39 goals-against average and a .922 save-percentage.
Hofer, a native of Winnipeg, Manitoba, was drafted by the Blues in the fourth round (No. 107 overall) in the 2018 NHL Draft.