Roglič took the yellow jersey after day two, having finished third in the individual time trial in the prologue and 13th in the first stage the next day.
After coming in 41st in the second stage on Thursday, he placed second both in Friday's mountain time trial and in the queens stage yesterday.
The final stage was won by German Pascal Ackermann ahead of Dane Michael Morkov and Italian Roberto Ferrari, while Roglič crossed the finish line 32nd with the main pack of riders.
This is Roglič's fifth tour victory. He placed third in the Tour de Romandie last year.
"We're all thrilled about this victory. We have shown that we are strong, have strong boys that are great to work and win with. I believe the prologue contributed to the final victory," Riglič said.
"I was upbeat going into the time trial. I was really strong and I'm happy to have done a good job," the 28-year-old former ski jumper added.
Last year, Roglič became the first Slovenian to win a Tour de France stage and he also took silver in the individual time trial at last year's World Cycling Championships.