Fortunately, butterworms are one of the easiest feeder insects to care for - and they last a long while! In fact, there's not much you can do to increase their lifespan beyond the typical 1 to 4 months, aside from following instructions to store them in a cool, dry place. Follow these guidelines if you want to ensure you've got butterworm storage nailed down perfectly.
Your butterworms will last longer if you store them at 40-50°F. The best location in most peoples' homes is the top shelf of their refrigerator door, which is the warmest spot in the fridge. It might be worthwhile to do a little preparation and experiment with your refrigerator settings until a thermometer in the door reads the correct temperature. If the temperature drops much lower than 40°F, they'll die from the cold. If the temperature is higher than about 60°F, their growth and metabolism will cause them to starve within a few weeks.
Don't add anything moist (like fruits or veggies) to your cup of butterworms - they most likely won't eat it, and doing so will raise the humidity. Humidity above 30% may result in mold growth, which will kill off your entire batch of bugs! If your butterworms' substrate becomes damp, you can replace it with fresh wheat bran or a similar dry grain product.