When can you take a hamster out of his cage?

When it is just running around in the cage doing nothing but not when it is asleep!!!!!!