There are 8 garbage cans in Pelican Town in the base Stardew Valley game. These cans are located near specific buildings: The Stardrop Saloon, 1 River Road, the Mayor's Manor, 1 Willow Lane, 2 Willow Lane, the Blacksmith, the Museum, and JojaMart/Movie Theater.
While some expanded or modded versions of the game mention more cans, the standard count for the original town is 8.