My answer to this question: Can a land-based organism get to be at least 100 ft. in length and still be plausible?1 may be useful.
The Longest known land animals, sauropodmorph dinosaurs, had thick bodies, but their long slender necks and tails were a bit snakelike.
The longest known sauropodmorph dinosaurs were estimated to have maximum lengths over 100 feet. And the legendary lost fossils of the possibly largest dinosaurs of all indicate a maximum length of up to 190 feet for the single specimen of one species.
So a snake like creature 100 feet long, 150 feet long, or even 200 feet long would have a lower body mass than the largest known land animals. But it wouldn't have legs to support its body above the ground, and so it's body would have to be strong enough to slither along the ground, and to avoid being crushed by gravity.
Some large snakes, like anacondas, actually live in mud and fresh water, and it might be theoretically possible for fresh water snakes to be much larger than anacondas and titanaboas.
I note that earthworms are snake or worm like creatures that burrow in the ground.
Crytozoolologist Ivan T. Sanderson once speculated that some northern European water monsters might be gigantic cacelians. Caecelians are limbless amphibians who live underground and underwater and look like earthworms or snakes. This theory was mentioned in David Drake's fantasy Arthurian novel The King's dragon 1979, revised as The dragon Lord 1982.
There are many snake like and worm like creatures in the oceans, with a big range in size.
Sea snakes are rather ordinary sized and are very venomous.
Many reported sea monsters or "sea serpents" were described as being serpentine. Many whales are rather slender, so a sea creature as wide as a whale but two or more times as long would probably seem serpentine.
Here is a link to a question about the size and anatomy of giant sea "serpents":
How large could my sea serpents be?2
There are many types of marine "worms".
The bootlace worm, Lineus longissimus has a very narrow and very long body.
Bootlace worms may grow very long but are usually only 5 to 10 millimetres (0.20 to 0.39 in) in width
In 1864 a specimen washed ashore in the aftermath of a severe storm by St Andrews, Scotland, which was more than 55 m (180 ft) long, longer than the longest known Lion's mane jellyfish, the animal which is often considered to be the longest in the world. However, records of extreme length should be taken with caution, because the bodies of nemerteans are flexible and can easily stretch to much more than their usual length.
The lion's mane jellyfish, also known as the giant jellyfish or the hair jelly,3 is the largest known species of jellyfish. Its range is confined to cold, boreal waters of the Arctic, northern Atlantic, and northern Pacific Oceans. It is common in the English Channel, Irish Sea, North Sea, and in western Scandinavian waters south to Kattegat and Øresund. It may also drift into the southwestern part of the Baltic Sea (where it cannot breed due to the low salinity). Similar jellyfish – which may be the same species – are known to inhabit seas near Australia and New Zealand. The largest recorded specimen was measured by Alexander Agassiz off the coast of Massachusetts in 1865 and had a bell with a diameter of 7 feet (2.1 m) and tentacles around 112 feet (34 m) long,4 although it was incorrectly reported by the Guinness Book of World Records that the sighting occurred in 1870 and that the jellyfish measured 120 feet long. Lion's mane jellyfish have been observed below 42°N latitude for some time in the larger bays of the east coast of the United States.
If a jellyfish with tentacles 112 feet long had two pointed straight apart, their tips would be 224 feet apart.
I find it easy to believe in the theoretical possibility of snake like or worm like sea creatures hundreds of feet long.
Added 11-15-19. And also see this question:
What kind of planet could have giant sand worms?5
It asks about sand worms, like in Dune. And maybe some of the answers will discuss the possible size range of hypothetical sandworms on an alien planet.