I can't be 100% from those pics but they look like detritus worms*to me. They happen in most freshwater tanks that are overfed and dirty. They are harmless and there because the food in there. I'd just recommend cleaning the tank really well and vacuuming the bottom. Also reduce feeding to just what the fish can eat. The population will drop quickly to something far less alarming. You may also see a flatworm or two in there. Back in I was first keeping tanks as a kid this happened to me and I panicked. Bleached the whole take fish and all. Now I know how silly I was and why it happened.