The Scot, who turns 44 this month, said he was following the example of compatriot and triple Formula One world champion Jackie Stewart who quit at the top in 1973 after winning his third title.
"As a racing driver it's important to stop at the right time when I'm still fast and capable of doing the job and the timing feels right after winning Le Mans for a third time this year and claiming the world title," he said in a statement.
McNish, who will continue to work with the Audi Le Mans factory team in various roles as well as devoting time to media and management, said he was ready to hand over to a younger generation.
"I've won the championships and races I wanted to win and frankly there's no better way to end my Audi sportscar race career than going out as a world champion," said McNish.
"My fellow Scot and mentor Jackie Stewart knew when to get into things but also knew when to get out and he has taught me that lesson."
McNish, who raced for Toyota in Formula One in 2002 without scoring a point, won 19 times with Audi teams and also took three American Le Mans titles.
He won the Le Mans 24 Hours in 1998, 2008 and this year and also had some big accidents at the Sarthe circuit including a spectacular one in 2011 that destroyed the car.
"There are some great new drivers coming through and they need an opportunity just like I did," said the Scot.
- Sports & Recreation
- Jackie Stewart