Adult non-biting gnats do not damage plants but are considered a nuisance. Usually, larvae do not cause serious plant damage, but when present in large numbers can stunt the plant growth and damage its roots. To prevent gnats from spreading, measures have to be taken to target immature stages of development of the species. Physical tactics include eliminating favorable living conditions: reduction of excess moisture, drainage of pools with standing water, and removal of decaying organic matter. Commercially available control agents and insecticides can be used as a control measure, but are not recommended for use in a household. To control adult gnats in smaller areas, pressurized aerosol sprays with pyrethrins can be used. Other control measures in the household can include turning off unnecessary lights at dusk and sealing vents and other openings.
Read more, here.