Fungus gnats occasionally become a nuisance indoors when adults emerge in large numbers as mosquito-like insects from potted plants or flower boxes containing damp soil rich in humus. Adults are attracted to lights and are often first noticed at windows. Larvae or maggots, which feed in soil high in orangic matter, can injure the roots of bedding plants, African violets, carnations, cyclamens, geraniums, poinsettias and foliage plants. Plant symptoms may appear as sudden wilting, loss of vigor, poor growth, yellowing and foliage loss. Some are serious pests in mushroom houses. Fungus gnats inhabit fungi or dead plant materials and are harmless to humans and animals.
Source: Ohio State University