In theory, a candidate could enter the primary at the national convention, after all primary votes have been cast, and win.
Officially, both parties choose their candidate by a vote of delegates from each state, which takes place at the party’s national convention. That is, nominally, the whole point of the convention. However, the state party’s rules require the delegate to vote according to the actual vote that took place in that state, and since those tallies are known, as are the rules, everyone knows how the vote is going to go before the vote actually happens, which means that everyone who isn’t going to win drops out and the vote becomes purely ceremonial. The convention, then, is “uncontested.” This is, by far, the normal and expected thing.
However, the rules require someone get an actual majority of the delegates’ votes. If no candidate manages to do that, and no one drops out, then there is a “contested convention.” These are rare in modern US politics,1 but they have happened—the last time it happened, in 1952, it actually happened to both parties. In a contested convention, the first time the delegates vote, they have to vote according to the rules—which results in no winner—but the vote is reheld repeatedly during the convention, and the delegates are allowed to change their votes on the ballots after the first. They will keep voting until someone wins.
Usually, the way a contested convention works is that one candidate or another decides to end their campaign and put their support towards one of the other candidates, ending the tie and resulting in a winner. This might be someone just deciding to just end the drama “for the good of the party,” this might be someone playing kingmaker, this might be someone who agrees to a compromise, like perhaps they become the vice president to whoever they throw their support behind.2 If that doesn’t happen, then the candidates just keep campaigning—now to the delegates personally, to try to get their support and reach that 50%+1 threshold.
But it is possible for a contested convention to just go nowhere. And if all of the actual candidates are refusing to end the log-jam, in theory it’s possible for the delegates to turn to someone else entirely for the nomination. Maybe the refusal to back down makes the actual candidates look bad and people start thinking they don’t want any of them. Maybe they turn to someone seen as a compromise between the actual candidates. Maybe the person they turn to was always more popular, but had decided not to run for whatever reason and is only now agreeing to accept the nomination to end the contested convention.
However, no contested convention has ever nominated someone who was previously not even in the race. There has, however, been at least one case of a compromise candidate being nominated. The 1924 Democratic National Convention infamously took 103 ballots,1 and eventually decided on John W. Davis, who was a candidate but had only 2.8% of the votes in the first ballot.
The structure of primary races these days makes such a result extremely unlikely. Contested conventions are seen as very bad politics in general, and to pick someone who wasn’t chosen by the people would look horribly undemocratic. John W. Davis was never president, which probably wasn’t much of a surprise to anyone. The pressure on candidates to make sure the convention remains uncontested would be immense, and if it became contested, the pressure to come to a swift compromise would be even more so. It’s hard to imagine a party ever being successful with a nominee who didn’t even run in the primary, which makes it hard to imagine a party ever choosing one even if a contested convention does drag on.
In practice, once voting starts happening, the conversation about who could be nominated tends to center around the actual results that have already taken place. That means that missing the filing deadline for candidacy, particularly in early states, is going to make a campaign likely dead-on-arrival.
When the actual filing deadlines are, however, is surprisingly difficult to determine! I will update here when I have more information. However, it’s apparent that Alabama’s and Arkansas’s deadlines are already passed—Gov. Deval Patrick will not be on the ballot at all in those states—and others are coming up soon. States where you’re not on the ballot are states you’re almost-certainly not going to win (though depending on the state’s write-in rules, perhaps not theoretically impossible).
Also, a candidate who misses filing deadlines simply isn’t likely to be taken very seriously.
Of course, Gov. Deval Patrick is widely seen as entering too late, as is Mayor Michael Bloomberg, who has been toying with candidacy, and it’s not really because of Alabama and Arkansas. There’s no way to put a firm date on when is “early enough” but having missed several debates and months’ worth of campaigning is undoubtedly a large, probably insurmountable, disadvantage.
The deadline to qualify for the first primary debate was June 12, and qualifying required either 3 national polls showing some minimum support, or donations from a large number of voters. Even a bombshell candidate is going to take at least a little bit of time to qualify, so in 2020, announcing candidacy after the very earliest days of June put you at a distinct disadvantage from the missed debate.
This part is impossible to quantify. Assuming a big name announced their candidacy in early June, and got the polling and/or donations required to enter the debate, they’re still at a large disadvantage because the other candidates had already been campaigning for months at that point. On the other hand, missing one debate probably isn’t damning in and of itself, either—someone who the electorate had already been looking for could plausibly get up to speed pretty quickly, even having missed a debate or two. Gov. Patrick and Mayor Bloomberg, at least, seem to believe that they can do this even having missed four or five debates.
I doubt Gov. Patrick and Mayor Bloomberg are correct, and from what I’ve read, most of the reporting on their candidacies has also been dubious. Would that have been different if they’d announced back in, say, August rather than November? Or, even if it had been, would three more months have allowed them to overcome that? There’s no way to know. Entering late is a disadvantage, but how large a disadvantage, and at what point that disadvantage becomes insurmountable, is going to vary heavily based on the circumstances of the campaign and election.
Between 1844 and 1936, the Democratic Party required a two-thirds majority rather than a 50%+1 majority, which made contested conventions vastly more common. Note this includes the notorious 1924 convention.
Candidates do not announce their vice-presidential picks until after they have won the nomination, in part because it keeps them free to offer such a compromise. There are other, more commonly-relevant reasons—namely that it makes the candidate look presumptuous in a way that voters tend to not like—but it still is a reason.