Barker won her second silver medal on Saturday's fourth day, claiming second place in the inaugural women's Madison alongside Emily Nelson.
And she was determined to prevail in the 100-lap (25-kilometres) points race, which featured 10 sprints, on Sunday's final day of competition after also finishing second in the scratch race on Wednesday's opening day.
Barker won with 59 points, Sarah Hammer of the United States was second on 51 and Kirsten Wild of Holland third with 35.
Track World Championships
Standout Glaetzer makes his mark at Track World Cup
12/11/2017 AT 13:36
The 22-year-old Cardiff rider had to show all her composure and dig deep when Hammer claimed a second lap of the field on her own and Barker combined with Wild and Belgium's Lotte Kopecky to take her second lap 10 laps from the end and seal victory.
It was Britain's fifth medal and second gold of the five-day competition, following Katie Archibald's omnium success on Friday.
Archibald and Barker won Olympic team pursuit gold in Rio, but the pair were given an individual focus here.
And Barker now has a third world title following team pursuit wins in 2013 and 2014.
Barker won the fourth sprint and with it five points and accelerated with Hammer in a bid to gain a lap - and an additional 20 points - on the field.
Barker won the fifth sprint, with Hammer second, moments before the pair rejoined the main group and were awarded their lap.
Barker moved to 30 points, with Hammer on 26 at the halfway stage.
Then the counter attacks began, but Barker followed them and claimed second at the next two sprints to add six to her total and establish a 10-point lead.
But Hammer won the eighth sprint and Barker failed to score, as the Briton's advantage was halved.

Elinor Barker takes world silver in scratch race

Hammer then went off in solo pursuit and claimed her second lap to take a significant lead.
Double points were available at the final sprint, but the margin was such that it could only be bridged if Barker could gain a lap.
She managed to form a group with Wild and Kopecky to quickly regain the initiative and then finished with a flourish by out-sprinting Hammer.
Barker then celebrated with the Union Flag.
Earlier, Katy Marchant made a first-round exit from the women's Keirin and Joe Truman finished 11th in qualification for the one-kilometre time-trial, recording a personal best but missing out on a second ride.
Track World Championships
Barker no longer bridesmaid as GB finish worlds fourth
16/04/2017 AT 12:42