Although I do not know exactly how many forfeited games there have been in NHL history, let's take a look a the first and the last such games today.
The first came on January 5th, 1918 in the NHL's inaugural season. The Montreal Wanderers were to play the Toronto Arenas.
The Wanderers' arena burned down just three days earlier and the club immediately folded. The NHL awarded forfeited wins to the Wanderers remaining opponents that season, the first of which was Toronto.
However that was not good enough for the Toronto Arenas. They wanted to ensure they received credit for its victory and actually played the game despite the lack of opposition. The game started with 5 Toronto skaters and their goalie on one side, and no one on the other. The referee dropped the puck and Cy Denneny carried the puck down the ice and shot it into the open net. The game was then called. Final score - Toronto Arenas 1 - Montreal Wanderers 0.
There has been some suspicion that the real reason Toronto went ahead with this shenanigan was to set up a lawsuit against the Montreal team, potentially to recoup lost gate receipts. I have found nothing to suggest anything ever came from the lawsuit idea.
The last forfeited game in NHL history is a very famous one. On March 17th, 1955 fans at the Montreal Forum began rioting after their hero Maurice Richard was suspended for the balance of the season plus the playoffs. During the first intermission a tear bomb went off in the rink. The famous (or is it infamous?) Rocket Richard Riots began inside the Montreal Forum and soon spilled out into the streets.
The NHL declared the game a forfeited win for the Detroit Red Wings.