I'm seeing a lot of people talk about the players, and it's all really sound advice, but I think the longevity of RPs, most especially in the beginning stages, relies upon the GM, the GM's discretion and the GM's pacing. Many people try to hype up their RPs as much as possible and put the cart before the horse so much so that people lose interest after the initial excitement and drop off when the setting, plot or whatever doesn't meet the supremely high bar the GM has set. Start at a moderate pace to let the players get their bearings, but don't wait too long for the hook, or else you will get impatient people dropping off. GMing is all about vigilance and flexibility. If the GM, while things are starting up, can't answer questions swiftly, post as expected or has to be summoned from the depths of Tartarus to commune with--simply, not showing to their players that they are willing or able to put in as much effort as they can to make the RP work, players will pick up on that and drop it before they get attached.
But then again, it's also total luck and being able to deal with player wipeouts. Accidents happen, computers have to be replaced, internet connections go out, people get swamped with work or blindsided by writer's block. You, any co-GMs and the players must be prepared for that to happen and have the capacity to operate as normally, or at least chug along at an appropriate pace until the missing limbs can return. If not, be prepared to at least open up for more, newer players (That has a danger all its own, of course--an RP I was in before Guildfall lasted over a year and died because veterans dropped off and newcomers piled on in big muddled droves. Choose your newcomers wisely and frugally). Both for the benefit of newcomers and returning players, as well as to keep everything in order and have plenty of unresolved plot points to go back to in times of need, try to keep up with a recap page. Put it in a passworded doc for a co-GM or even the players to add on to, but keep it concise and only as detailed as it needs to be. I know it would be a bit of a hassle, but in the long run, it could save RPs or provide interesting fodder for plot development.
So there's my two cents, mostly from other peoples' advice as well as things I've discovered through both GMing and participating in many, many RPs.
Another extra tidbit: Know when to quit, when to reboot and when to salvage. It'll save you time, energy and stress.