This depends largely on the size of your snake. Hatchling snakes will prefer smaller enclosures as they stress most of the time in larger enclosures and they can stop eating.
Usually the rule of thumb is that the length of the cage must be twice the snakes length and the height and bredth of the cage must be half the snake length.
It will depend on the size and type of snake you have.
Arboreal or tree dwelling snakes will require a much taller enclosure than terrestrial or ground dwelling snakes who do not climb.