Hansen twice broke the record in the opening two rounds only to see Cameroon's Francoise Mbango take the lead in the last round with yet another Games record of 14.82m.
But Hansen, who was next up, responded in stunning fashion as she jumped 14.86m to set her third record of the night.
Trecia Smith of Jamaica took bronze with 14.32m.
It was a dramatic effort from the English athlete, who was lifted by Mbango's reaction after the African had taken the lead.
"Because she started waving to the crowd like she'd done it, it made me want it even more," said Hansen.
"I knew [I'd won]. I don't know how because it was only four centimetres but I just knew.
"Everything fell into place and it was just fantastic.
"Its lovely to come back and win. Hopefully this is one of many."