He guided the All Blacks their second consecutive World Cup trophy in 2015 and next year will try to become the first man to steer a side to two World Cup triumphs.
"I think it's right for the team to have someone new after the World Cup, some fresh eyes, some fresh thinking," said Hansen.
Under his stewardship, the All Blacks have won 85 Test matches, lost eight and drwan three times.
"His record is unsurpassed," said New Zealand Rugby chairman Brent Impey. "Whatever happens next in Steve's career, his place as a New Zealand rugby legend is guaranteed."
The departure of the 59-year-old will start a scramble for his position. His assistant coach, Ian Foster, and Ireland's New Zealand-born coach Joe Schmidt are considered the frontrunners to replace him.
During his time in charge, Hansen has displayed a discerning eye for talent and instilled an ethos of constant improvement. The vision has reaped dividends since the 2015 World Cup win.
Despite the international retirements of skipper Richie McCaw, Dan Carter, Ma'a Nonu and Conrad Smith, the All Blacks have maintained their primacy.
They have won the southern hemisphere's four team tournament the Rugby Championship three times and have been the side to beat.
However World Cup glory remains the priority. "It's probably going to be the toughest World Cup from a competitive point of view," Hansen said.
"The northern hemisphere have really come to the party since the last one and got themselves in good nick. I think Australia and South Africa are capable of winning it if they get their stuff sorted."