The deal, which was confirmed ahead of Sunday's Emilia-Romagna GP, follows years of work from F1 owners Liberty Media since their acquisition of the sport in 2017.
Miami becomes the second F1 race in the US, with Austin's Circuit of the Americas a permanent fixture on the calendar since 2012.
A date for the race is yet to be announced
New F1 CEO Stefano Domenicali said: "We are thrilled to announce that Formula One will be racing in Miami beginning in 2022.
"The US is a key growth market for us, and we are greatly encouraged by our growing reach in the US which will be further supported by this exciting second race.
"We will be working closely with the team from Hard Rock Stadium and the FIA to ensure the circuit delivers sensational racing but also leaves a positive and lasting contribution for the people in the local community.
"We are looking forward to bringing the greatest racing spectacle on the planet to Miami for the first time in our sport's history."