I can't magnify the photo enough to be sure, but they look like planaria. They are scavengers and harmless. An extremely large number of them, as in the photo, usually indicates over-feeding or a dead fish in the tank that has not been discovered and removed.
In order to tell if they are planaria, we need a almost microscopic image of their head. It would be triangular like an arrow if it was planaria.
Either planaria or deitrus worms. I cant say anything until further pics are taken.