They are likely fungus gnats. They lay their eggs in moist soil, the larvae eat fungus in the substrate, when they hatch they fly away and start the cycle over. They are not dangerous, just annoying. Not sure what the best method is to get rid of them. It seems like the majority of the ones I had disappeared after I covered all of my substrate with sheets of live moss, dunno why.