If I count just campaigns physically played then it’s probably not that long. I played an 8 year old girl named Mina in a friends D&D campaign from 1st to 12th level, but that probably only lasted a year or so. Mina was awesome, having absolutely no direct combat abilities and relying purely on her abilities to buff other characters through inspirational abilities based on the Marshal class in 3.5.
Outside physical games them it’s probably the Galen Saga. This was played over an extended period of time, years in fact, on the message boards of the Secrets of Kargatane website before it shut down. In that game I played a clone of my namesake, Trebor Minntt, trapped and altered within the demi-plane of Ravenloft. The story followed the adventures of the Taverners, patrons of the Malodorous Goat Tavern in Vallaki, as they tried to protect and understand the truth behind the mysterious child Galen, who appeared on the taverns doorstep one day. It was purely play by post, no dice rolls, no DM, it was freeform and collaborative story telling at it’s best and it was amazing.
As I’ve said many times, I’m a DM far more than a player and the longest campaign I’ve ever run was probably the first one that I ran when i moved away to go to University. It was D&D 3rd edition (leading to 3.5)ran for 2-3 years, I don’t remember exactly, and that was playing at least twice per week for 6+ hours a time with many multi day sessions as part of it. It ran from 1st to 22nd level, give or take, and took the players from my homebrew world, to Ravenloft, to Planescape and finally back to my own world.
The plot of the campaign was complex, twisting and turning many times, but, basically, it saw the PC’s being played off between two Yugoloths, Anthraxus and Bubonix, and trying to prevent an Tanar’ri incursion of their home world. They played through Ravenloft’s Nightmare Lands and Castles Forlorn, and the Planescape modules Hellbound the Blood War, Dead Gods (including battling Orcus), Harbinger House, Doors to the Unknown and more besides.
I vastly prefer long campaigns, I think they allow for true character development and story options that shorter campaigns simply can’t achieve. Playing the same character for years makes them a part of you in a way that can’t be replicated in the course of a few months and it lets the DM tell an epic story.
I liken long campaigns to TV shows. Single episodes can be fun, but the story told over the course of the whole season is more interesting and when that links to develop the plot of the shows entire run then it becomes something special. Look at Buffy, it has great single episodes, like Hush, fantastic seasons, like season 3, but it’s when you take the whole journey, from season 1-7 and combine it that you feel like you’ve been on an epic journey with the characters. Thats the kind of story I like to tell and participate in.