Ledecky led from the start and inexorably stretched out the gap over her opponents to finish in eight minutes, 4.79 seconds, beating her previous mark of 8:06.68 set in Austin, Texas in January.
Britain's Jazz Carlin won her second silver medal in 8:16.17, and Boglarka Kapas of Hungary took the bronze.
Ledecky, defending Olympic champion at the distance, added to her golds earlier in the week in the 200 and 400 freestyle and the 4x200 freestyle relay, plus a silver in the 4x100 relay.
"I have to wait another four years to have this moment and I just wanted to enjoy it all and put my very best swim out there," Ledecky said after her final race in Rio.
She said that Meyer had sent her a video message of support via her mother before the race.
"I try not to think about the history of it much, but just to be mentioned in the same sentence as her is incredible," she said.
Ledecky sliced 1.89 seconds off her own record in the longest event of the women's swimming program.
It was the seventh world swimming record of the Rio Games, and the second by Ledecky, who achieved a similar feat in winning the 400 freestyle.
Since winning the 800 in London four years ago, she has been invincible, and anything but a victory for the 19-year-old would have been one of the biggest shocks of the Games.
Carlin and Kapas fought a dogged struggle for second, with Spain's Mireia Belmonte Garcia challenging them for much of the way.
Ledecky is moving to Stanford University later this year.
"Bruce doesn't cry very often but it was a very happy moment and it's been a pleasure to share this journey with him," Ledecky told the media conference, saying she would be setting ambitious goals once at Stanford.
"It's been a great four years and I know I can have another great four years and I know that I will have a lot of people supporting me."