The cities will share hosting duties in the preliminary rounds, with Toronto the site of the 2015 medal round and Montreal hosting the medal games in 2017.
"This is an exciting day for hockey fans in the provinces of Quebec and Ontario, as well as throughout Canada," Hockey Canada president and CEO Bob Nicholson said in a statement. "These two cities have a proud hockey tradition and have shown interest in this event for many years."
Canada has hosted the event on 10 previous occasions dating back to 1978, when Wayne Gretzky led all players with 18 points in a tournament that took place in Montreal. It has never been held in Toronto.
Canada played host just twice in the first 14 years of the tournament's existence, but as the event has grown in popularity, the International Ice Hockey Federation has relied on the economic viability on holding it in this country.
Hockey Canada said in the release the 2012 tournament from Edmonton and Calgary allowed the organized to provide about $21 million in funding to hockey groups across the country.
The upcoming tournament in December will be held in Sweden.
Hockey Canada is scheduling media events in both Toronto and Montreal later Thursday to provide further details.