Internationally, each team is allowed to have up to 20 players with six team officials on the bench per the International Ice Hockey Federation. Countries who participate in the Olympics and other international games follow this rule. These are usually games for (amateur) players, which are not paid. College teams typically have a few more players than international sports, and in the United States the number is roughly around 24.
Professionally, this figure changes as the needs for the team change. For example, the National Hockey League (NHL) can have four separate rosters with 23 active player roster (standard contract), 20 player dressed list for games, a 50 contract minimum, and a 90 player maximum reserve list. In total, teams can have up to 90 players on its reserve list including injured players. As you can see, that in the professional league the rules are quite different than amateur players, but this league is just in the United States and Canada.