The 34-year-old flanker played a world record 148 Tests, 131 of them wins, and led the All Blacks to two World Cup final victories, including last month's triumph against Australia.
McCaw is also a three-time winner of the World Player of the Year award.
The news, expected for some time, comes 24 hours after the death of iconic All Blacks winger Jonah Lomu.
"Today, I thought about whether it was the right thing to do this," said McCaw. "But I'm going to be hanging up my boots."
Before the news conference to announce his retirement those present held a minute's silence in memory of Lomu, whose death at the age of 40 was described as "a big shock" by McCaw.
"My thoughts and condolences go to his wife and two boys," added McCaw, a former team-mate of the giant winger.
"When I became an All Black he was in the team. To play with him was amazing. I remember one of my first games, I climbed off the bus and the mob came towards me and I thought 'this is pretty cool, being an All Black' but they kept going because they only wanted to be near to Jonah.
"There are a lot of people round the world hurting at the loss of a great man."
McCaw, who now plans to pursue a career as a helicopter pilot, won 130 of his Tests and captained the All Blacks 109 times - both also all-time world records.
"My last game was the World Cup final, so the end of something that has been a big part of my life," he said.
"I made no secret this year was probably going to be my last, but deep down I didn't want to shut the door totally. I was worried the emotion might get to me in a World Cup year, by leaving that door open it didn't feel final until now.
"It has been a hell of a journey over the last 15 years. I've been privileged to do what I love for so long. Here's to new adventures."
McCaw said he had played some of his best rugby "in the last few weeks", and All Blacks coach Steve Hansen agreed, saying the World Cup final was "one of his best games".
"We will miss him but he has to pick the right time to go and he has done that," said Hansen. "On the top of the heap."