Before election:
DNC decides, method not specified
RNC fills vacancy, reconvene convention or RNC state representitves vote, simple majority wins
Just before the election:
Congress may pass special legislation to move back election day to give more time for the party to select a new candidate and regroup
11/4 Election
After election, but before Electoral College
No federal law. Electors open to vote for VP, third party, or convention runner up. State laws may affect elector's abilities to select.
12/15 Electoral College
After Electoral College, before Congress counts the votes
Congress counts Electoral College votes and declares winner. Winner's VP gets it
1/6 Congressional Vote Count
After Congressional count but before inauguration;
Per 20th Amendment, VP gets it, but only applies after candidate becomes 'President-Elect" That is certainly after Congressional count.
1/20 Inauguration
VP gets it