In my case, I always kept them in their jewel boxes, which were stored vertically, much like you'd store an LP. For most of their life they were kept indoors, but they also spent about 3 years in an unheated storage unit.
The fun part was finding adapters for the few 8 cm CD singles I had, so they'd play in a modern slot-loading drive.