Hamsters are small, but they still need a certain amount of space. You can read recommended sizes for different breeds below:
Syrian (Golden) Hamster: 100 cm * 50 cm
Campbellās & Winter White (Dwarf Hamsters): 80 cm * 50 cm
Roborovski Hamster: 100 cm * 50 cm
Usually, pet shop cages are too small. Small cages cause chronic stress and stress (stereotypic) behaviors , brain and cognitive effects, reduced natural behavior and physical health problems. A hamster that tries to run away many times and fails will learn helplessness; it will stop exploring, and become inactive, as well as excessive sleeping.

And besides the size, you will want to consider the following qualities as well when purchasing a cage:
1: A barless cage
Bars are not bad by themselves, but many owners choose barless cages to avoid probable chewing by the hamster.
2: Enough height (they don’t make up for the floor space, but are still important.)
Hamsters run in their wheel for many hours, and the right-size wheel requires enough height. They also need a deep bedding for burrowing.
3: Max. space between bars (if buying a cage with bars,) should be about:
1.2 cm for Syrian Hamsters
0.8 cm for dwarf or Roborovski Hamsters
This will prevent escapes or stuck paws. Also, make sure the bars are smooth, not sharp.