According to the Smithsonian:
The longest of all known polychaetes was found in Port Jackson, Australia. It was a member of the family Eunicidae, consisted of approximately 1,500 segments and was nearly 6 meters long when alive.
The Eunicidae consist of numerous species (including the super cool bobbit worm), many of which get fairly large.
Though, typically 3 m in considered quite large for worms in this group (e.g., see Uchida et al. 2009 for a description of a 3 m long Eunice aphroditois).
Polychaetes & Allies: The Southern Synthesis also suggests that members of Eucinidae can reach 6 m in length. From p. 94 of this report from the Australian Biological Resources Study:
Eunicids have many segments and may attain a length of up to 6m...
...Eunicids range from less than 10cm to 6m in length, and consists of up to 1500 segments (Fauchald 1992a).
Supposedly, according to Schulze 2011:
The Australian museum even holds a specimen that reportedly was nearly 6 m long when collected (Fauchald 1992 and pers. comm.)
Salazar-Vallejo et al. (2011) also cite evidence of 3+ m long polychaetes in the genus Eunice as evidence that the genus is "the largest polychaete species and placing them among the longest benthic invertebrates."
None of these worms compare to a species of ribbon worm (phylum Nemertea) called Lineus longissimus that can reach 55 m in length! [Sources: 1, 2].