In the Wii version there are 32 stages in total: 7 daytime levels where Sonic runs at full speed, and 25 nighttime levels where he fights as the Werehog.
The split is the defining feature of the game, and opinions divide sharply on which half is better. The daytime stages are fast and momentum-driven, while the night stages are slower combat-and-platforming sections that many players found a slog.
Other versions of the game have different stage counts, so the number depends on which release you have.