The 23-year-old midfielder fired a 40-yard rocket that Trinidad goalkeeper Jan Michael Williams managed to get a hand on, but couldn't prevent from crossing the line.
Cuba earned the trophy, winning its last four games by a combined score of 5-1, following a 1-0 loss to Martinique in its opener.
In a match marked by its tactical nature, Carlyle Mitchell almost put the Soca Warriors ahead in the sixth minute with a header that hit the post off a corner kick.
The close call caught Cuba's attention and it increased the urgency of its attack in response. Alberto Gomez, 10 minutes later, shot inches wide after the midfielder electrified the crowd with an impressive display of dribbling.
In the 40th minute, Trinidad's Atullah Guerra was set-up beautifully by Kevon Carter for a clear shot at the top of the Cuban 18-yard box, but he failed to control the ball cleanly.
Five minutes after the break, Keyon Edwards tried to get the Soca Warriors on the scoreboard through an ambitious 20-yard attempt that caused goalkeeper Odelin Molina to produce a diving save.
The Lions of the Caribbean should have gone ahead in the 61st minute, when Williams tackled Hernandez in the box and referee Valdin Legister pointed to the penalty spot. Cuba's joy was temporary, as Jaine Colome Valencia blazed his shot over the crossbar.
That agonizing miss, though, faded to memory in extra time, overshadowed by the euphoria of Hernandez's game-winner with eight minutes left on the clock.
The game was a rematch of the 1999 final, which Trinidad won 2-1 at home in Port of Spain.
Cuba, Trinidad, Haiti and Martinique - the tournament's top four finishers, respectively - will represent the Caribbean at the 2013 CONCACAF Gold Cup.