Honestly, there are two approaches to this, in my experience.
The outdoor pumpkin is far more exposed to mold and bacteria. It also is the one most likely to have an electric light. It gets the whole treatment.
Indoor pumpkins can still mold in a few days, but they don't need the hardcore sterilization, which is good because they will most likely have a real candle.
Whether indoor or outdoor, the bleach water treatment makes a huge difference. It doesn't take a lot of bleach, a capful to a gallon.
*Carve and clean your jacks, then submerge them in a plastic tub with the bleach water for about ten minutes. Make sure you add the pumpkin lids as well.
*Take them out and rest them on a towel. Let them air-dry for about a day.
At this point, you can sprinkle cinnamon and clove on the lids and the interior of the indoor ones. They should hold up just fine for the next 3-5 days. If you are worried, you can always mist the interior every morning with a weak bleach water solution. This keeps the pumpkin from shriveling too quickly and kills any visiting bugs.
And no, the bleach smell is not bad at all. Once lit, the cinnamon/clove smell conquers everything. As an added boost, use pumpkin scented candles.
Outdoor pumpkins get a little extra. After the bleach water bath, they dry for a day and then get misted every day with this solution;
1/3 water, 1/3 vinegar, 1/3 lemon juice.
Make sure you take the lights out before misting.
Electronics and acids don't mix.