It is generally considered safe to wear a chastity cage for hours at a time. The best cages are designed with adequate ventilation to keep things clean and fresh (and most can go in the shower with you as well), and they have holes in the end for urination. It is not safe or recommended to sleep in chastity cages.