Keep them in the fridge and they'll live much longer. Every couple of days you should take the pupae out for a couple of hours at room temperature to help their development. Once they hatch they can live several weeks when refrigerated. Also, you can just place the pupae in the enclosure and just let them hatch out right in the enclosure. Once they have hatched, place them in the freezer for a couple of minutes to stun them long enough to feed out. Once they hatch if you leave them at room temperature they won't live very long since their metabolisms speed up.