After Porto forward Mehdi Taremi was sent off late on for a second yellow card, Mario Hermoso's deflected shot looked to have won the game for Atletico in the 92nd minute.
But Hermoso went from hero to villain when he conceded a penalty for a handball, with Matheus Uribe squeezing the spot-kick beyond Atletico goalkeeper Jan Oblak.
France forward Griezmann snatched victory for Diego Simeone's side with virtually the final touch as he headed in at the far post following a flick-on at a corner to send Atletico top of Group B.
"Scoring the winning goal is very nice, but I'll stick with the three points," Griezmann told Movistar.
"We already know that anything can happen here (at the Metropolitano) until the last second."
Atletico are level on points with Club Brugge after the Belgian champions won 1-0 at home to Bayer Leverkusen.