Williamson has long been seen as McCullum's heir apparent and has already skippered the Black Caps in several one-day and Twenty20 matches.
"Kane has been a leader within the team for a long time now and already shown himself to be an extremely capable captain," NZ Cricket chief executive David White said.
"He's respected by his peers and the wider cricket community for his professional approach both on and off the field, and has a superb cricket brain."
"It's certainly an honour... (I) believe this team can achieve a lot," he said in a statement.
More From This Section
Williamson led New Zealand on a giant-killing charge to the semi-finals at the recent World Twenty20 tournament in India, winning praise for his bold use of spin.
Known for his calm demeanour under pressure, he made his international debut in 2010 against India.
He was named Wisden Almanack's Leading Cricketer in the World this month after amassing 2,692 international runs across all formats last year -- the third-highest annual aggregate ever.
He already has an average of 49.23 from 48 Tests, including 13 centuries, and averages 47.00 from 93 one-dayers.
His Test figures include a career-best 242 not out against Sri Lanka in Wellington last year to give the Black Caps a stunning come-from-behind victory.
Coach Mike Hesson said he did not believe the captaincy duties would prove a distraction for Williamson at the crease.
"He's got that ability to go into his little bubble when he bats and hopefully we can keep that," he said.