In 2011 and 2013, Wiggins finished second behind Germany's Tony Martin.
However, on this occasion the 34-year-old Brit, who clocked a time of 56:22.52, got the better of Martin by a 26.23-second margin over the 30-mile course in Ponferrada.
"I knew coming into it that I had the legs. Once I saw the course I realised if I was ever going to beat Tony again it was on a course like this," BBC Sport has quoted Wiggins as saying.
"It's been an up and down year. Obviously I didn't ride the Tour de France. I want to dedicate this to my family because they had to put up with me when I was at home in July. It's my last Road World Championships and I've finished with a gold medal."
Tom Dumoulin, a rider from the Netherlands, claimed bronze.