Gilmore won when world number one Lakey Peterson was upset in the second round by fellow American Alana Blanchard, eliminating the only competitor who could have stopped her from taking the title.
"I was not expecting this right now," she said.
"I just went home to chill out and get ready for a battle and Alana just freaked out there. Oh my gosh, I can't believe it."
Women surfing - Tokyo 2020 - Olympic Highlights
Gilmore defeated Sage Erickson and Blanchard en route to her first title since 2014.
The 30-year-old from Queensland state is now four world titles shy of Kelly Slater's all-time record of 11 on the men's tour.
Brazil's Italo Ferreira carves out history as first Olympic surfing champ
Tokyo 2020 - United States vs South Africa - Surfing - Olympic Highlights