It's a mix of luck and how willing both people are to communicate.
Like the others have said, sometimes people just don't click due to their differences in writing style, skill, or preferences. The roleplay resume can be pretty helpful when it comes to finding out what your potential partner prefers, but it isn't enough, so talking to them helps too.
Usually, before committing I try to brainstorm with a potential partner, and if we can't come up with something we're both happy with, or if my potential partner leaves all the planning to me, then it's a sign that the partnership isn't going to last that long.
I definitely agree with
@Sarre, going through a potential partner's RPs is super helpful. By checking their history, you get to check out their writing style and writing habbits, what they're like on the OOC, how often they post, if they stick with the RPs they join and etc.
On average, just before soneone writes that first post, how well do you know your partner?
I noticed that 1x1's or RPs done with friends or past RP partners tend to last longer, and because of this I usually RP with friends or people I chat with from time to time. Most of the 1x1's I've done with people I have just met tend to die really quickly, if I'm lucky they last a month or two tops.
I've never finished a 1x1, but a few of the ones that I've done with friends have lasted between months to a little over a year. Maybe it's because there's more trust and it's easier to talk about what we want for the characters and where we want to go with the RP. In my opinion, communication is definitely the key to a healthy RP ^^