The NHL first implemented its salary cap in 2005. More precisely, the cap took effect for the 2005–06 season after the 2004–05 lockout and the ratification of a new collective bargaining agreement.
The labor dispute canceled the entire 2004–05 season. Owners wanted a system that limited team payrolls and tied spending to league economics, while players resisted the proposed restrictions. The agreement that ended the lockout created a hard upper limit on team salaries, along with a lower payroll limit and revenue-sharing provisions.
The initial 2005–06 team salary cap was $39 million. It was not a limit on an individual player’s salary alone: it applied to the combined payroll of an entire team. The cap has since changed according to league revenue and collective bargaining agreements. Therefore, 2006 is not the best answer; it was the second season of the cap era, not its starting year.