Currently the longest single-state mileage of any US route is 893 miles (US 83 in Texas). Historically, before US 101 was truncated to Los Angeles, that route was undoubtedly the record-holder: the California segment of US 101 was about 941 miles (give or take a few, depending on which year, since the alignment changed many times and in many places).
Historic US 99 in California was the second-longest route through a single state, although its mileage is even more difficult to measure, since it was replaced by I-5 in many areas, and as a result some segments of the original route have been vacated. The Historic Highway 99 Association of California offers a length of 917 miles. Although that page does not specify a year, I am sure that figure is reliable, since my own back-of-the-envelope calculation yielded a similar distance. (Note that drivers choosing US 99E between Sacramento and Red Bluff had to travel 2.2 miles further than those who chose US 99W.)
Thanks to this blog post, I recently became aware of "the Palm and the Pine" along what is now CA state hwy. 99, just southeast of Madera. In the median of the highway, a palm tree and a pine tree are planted side by side (one representing southern California, and the other representing northern California):