Daley dived twice from 10m and once from 3m, while Gallantree completed the reverse routines.
They scored 434.65, with Ukraine (426.45) winning silver and China (425.40) bronze in Kazan, Russia.
Britain won bronze on Tuesday in the synchronised 3m springboard.
It is the first time Britain has claimed two medals at a World diving championships and Gallantree becomes the first British female to win a medal at World level.
"We didn't have any expectations ahead of the competition as we know China is so strong and it felt surreal to be competing and, the next thing, we're on top of the podium," said Olympic bronze medallist Daley.
"It's an insane feeling and thanks to Becky for diving so well."
Gallantree said she could not believe she and Daley had won, saying: "We came in for a bit of fun and to practise ahead of our individual events, but it became a bit more than that.
"I never thought I would be a world champion and it's amazing to say now that I am."
Earlier on Wednesday, Olympian Tonia Couch qualified for Thursday's individual 10m platform final and in doing so secured Team GB a place in the event at the Rio Olympics.
The British pair were in third after the first round of an event which featured China's multiple world champion Ruolin Chen and USA's London 2012 10m champion David Boudia.
Two stunning routines by Daley and solid performances from Gallantree saw them move clear of their opponents in the final rounds.
Daley was using the non-Olympic Team event as a warm-up before his individual 10m platform campaign begins on Saturday.
Gallantree, who came 10th alongside Alicia Blagg in the synchronised 3m springboard final on Saturday, will compete in the individual 3m event on Friday.

Pollard bowled a big no-ball when Lewis was on 97 off 32 balls, with St Kitts and Nevis Patriots needing one run to beat Barbados Tridents in the Twenty20 competition.
The no-ball gave 25-year-old Lewis' side the win but saw him miss out on the chance of a ton after he and captain Chris Gayle reached 129-0.
Cricket statistician and journalist Mazher Arshad said: "So Kieron Pollard bowls a no-ball to deny Evin Lewis a hundred in CPL. Suraj Randiv was suspended for a match when he did that to [Virender] Sehwag in 2010."
Cricket supporter Mainraj Paudel called Pollard's actions a "shameless act" on Twitter, while another spectator, Abhishek Chaturvedi, accused Pollard of showing "zero sportsmanship".
Lewis, however, was more diplomatic.
In a televised post-match interview, he said: "It hurts [missing out on the hundred], but hitting 97 not out off 33 balls? I'll take that any day.
"I've been hitting the ball long and hard in the nets. I'm confident now and looking forward to the play-offs."
If Lewis had completed his century in 33 balls, it would have been the second fastest of all time - just behind Chris Gayle's 30-ball IPL knock in 2013.

Time Warner, which owns HBO and CNN, will also advertise on the service.
The deal comes as television companies look to capture growing digital audiences and rival tech platforms, such as Facebook, add video content.
It boosted shares of both companies, sending Snapchat's stock up almost 2%.
Snapchat started in 2011 as a picture-messaging app and now has more than 150 million daily users.
It became a publicly traded company earlier this year.
The firm has worked with companies, including the BBC, as it broadens the content available.
Its shows typically last for three to five minutes.
Currently one show airs on Snapchat each day. That number is expected to increase to three by the end of the year, according to the company.
Time Warner's contributions will include comedy and scripted drama.
The firm has produced many hit films and TV shows including Wonder Woman and Game of Thrones.
The two-year partnership is valued at about $100m, according to Reuters.
British divers have claimed their second medal of the World Aquatics Championships with Tom Daley and Rebecca Gallantree combining to win gold in the team event.
[NEXT_CONCEPT]
Kieron Pollard has been criticised on social media after bowling a no-ball which denied opposition batsman Evin Lewis the chance of a century in a Caribbean Premier League match.
[NEXT_CONCEPT]
Media giant Time Warner will produce shows for audiences on the social media platform Snapchat as part of a new partnership that the two companies announced on Monday.