I am a member of OpenWorm.org, an open-source project that aims to simulate a C. elegans cell-by-cell. I didn't know the answer to this myself off the top of my head, but I have access to a number of folks who have been working hard on C. elegans anatomy for the last couple of years so I went ahead and asked them this question on our discuss mailing list. Thanks to Chris Grove and Tim Busbice for providing the answer that I am reporting below:
Chris Grove:
Finding the neuron with the largest span partly depends on your
definition of "length" in this context. In terms of largest amount of
total axon/dendrite length, this would most probably be the PVDL/PVDR
sensory neurons. They produce a large number of branches of dendrites
that act to perceive mechano and thermo-sensation. See the WormAtlas
page here.
Tim Busbice:
If by "length" one means, absolute longest extension from head to
tail, that's a tougher call, as there are several that extend from the
head to the tail. An example of these are the AVDL/AVDR command
interneurons, that function as touch modulators for backward
locomotion induced by head-touch, and also drive backward movement of
the animal along with driver cell AVA neuron, AVE and A-type motor
neurons.
You can find a lot of info on C. elegans anatomy on WormAtlas and on an OpenWorm data spreadsheet in which we are consolidating detailed anatomy data from different sources.
Also I would advise checking out the OpenWorm Browser - a web-based 3D viewer that you can use to explore the C. elegans anatomy cell-by-cell (the 3D model was developed by Chris Grove, see VirtualWorm for details). For instance you can easily search for those "longest" neurons mentioned above! Screenshot of one of them selected (AVDL) below:
Hope this helped!