Stoudemire, a six-time All-Star, posted a photo of himself signing the contract on Instagram.
Heat president Pat Riley said in a statement that Stoudemire "is going to bring gravitas, leadership and a hardworking mentality to our team."
In other Heat transactions, Dwyane Wade has finalized his deal to stay in Miami.
Wade signed his one-year, $20 million contract Friday to stay with the Heat, that deal getting closed around the same time Stoudemire completed a physical and an interview before signing his contract.
Wade is coming off a season in which he averaged 21.5 points per game and was an All-Star for the 11th time. He has been a part of all three of Miami's title seasons, and Riley said Wade "will lead us as we look to win another NBA championship."
Wade's signing was expected after he committed last week. Stoudemire being added was more of a surprise, especially considering that the Heat didn't have oodles of extra money to spend.
But when Stoudemire made it clear that he wasn't looking for a big-money deal, things fell into place for him and the Heat. Stoudemire also is familiar with Miami, having had a home there for some time. He's also taken classes and done workouts in the past at Florida International University and the University of Miami.
The Associated Press contributed to this report.