Habitat Influences Lifespan
The answer to this question depends upon the species of gnat, their reproductive potential and the favorability and quality of their chosen habitat. Habitat favorability includes such things as the quality, quantity and availability of food sources, plus access to available moisture and protection within their habitat.
As an example, fungus gnats commonly develop in residential potted plants and large ornamental plantings within commercial malls and business site lobbies. When these sites are overwatered, fungus gnats generally live longer and produce more offspring than when plant soil is kept only damp enough to sustain healthy plants.
Development Through Metamorphosis
These flies all develop via complete metamorphosis and go through four life stages – egg, larvae, pupae and adult. The longevity of these gnats is not very impressive since they do not live for a long time. However, their ability to reproduce and keep themselves well populated is very impressive. For example, fruit fly adults do not live very long, but each female fly has the potential to deposit as many as 500 eggs or more in her lifetime.
Fruit fly adults may live from about 40-50 days or less and can take from 35-60 days to complete a life cycle.
Phorid fly adults may live from about 8-14 days and the life cycle may take from as few as 8 days to about 37 days to complete.
Fungus gnat adults may live from about one to two weeks and complete one life cycle in about 18-30 days.
Moth fly adults live for about 14 days and complete their life cycle in about 7-21 days.