How long can you keep your hamster in the cage without taking it out?

for about a week or so because if you do not let him see and play outside of his cage he will be unhappy