It depends what the Senate “sentences” the president to when they “convict” them:1
Judgment in Cases of Impeachment shall not extend further than to removal from Office, and disqualification to hold and enjoy any Office of honor, Trust or Profit under the United States
—Article I, Section 3, Clause 7 of the United States Constitution
As you can see, the US Constitution allows the Senate to apply one or both of only two judgments on an impeached officer: removal from office, and/or disqualification from being able to hold any government offices in the future.
With the president removed from office, the vice president is sworn in as president. If there is no vice president (e.g. as happened with Nixon, though he was not formally removed from office), the Speaker of the House is sworn in as president instead. And so on and so forth until someone who can be president is found; there’s a defined order of succession for any case that causes a sudden need for a new president (usually the death of the previous one but impeachment and removal would also do it). This does not affect the upcoming election in any way, though with an election coming up, the new president is unlikely to have very much power or ability to get something done—the ultimate “lame duck presidency.”
If the Senate votes to remove the president from office, but not to bar him from future office—a very unlikely scenario since it’s hard to imagine why anyone would vote for the first but not the second—then the impeached president and current party nominee is still eligible for the presidency and so, if re-elected, can be president again.
In the vastly more likely case—that if they’re removing the president from office, they’re also barring them from future office—then the impeached president cannot be president again. What happens at that point is far, far murkier.
Each state has its own laws about how elections are run. Some states will allow the nominee to be changed on the ballot, or even require it, while others might not allow the ballot to be changed, depending on how close we are to the election. Some states will have laws specifying what electors are to do in such a situation, but most won’t—most state laws just say that electors have to go to the electoral college and vote for whoever won that state. If that was the impeached president, it’s unclear what the electors should do—the state law they have to vote for someone who is ineligible. Do they vote for the impeached, ineligible president anyway? Or do they vote for the party’s replacement nominee, or for whoever the impeached president’s running mate was (even if that person is not the party’s choice of replacement)? And if the electors do cast “throw-away” votes for the impeached president, and those votes are majority, what are we to make of that? Do they not count, resulting in a victory for whoever came in second, or do they count for the running mate, who becomes president instead of vice president? Or, what if the electors break their various state laws—since those laws weren’t written to handle this—and cast votes for whoever they personally feel like is most appropriate—does that count?
We have no answers to these questions. The Constitution does not specify—the Constitution imagined that the electoral college would handle this situation, did not anticipate the states passing laws that attempt to strictly control what the electors can do. And those laws may well not have anticipated such a situation, and may force the electors to do something problematic.
If this actually came up, my guess is that states would scramble to amend their laws to account for it, assuming there is enough time. If not, we would almost-certainly have a Constitutional crisis. There would be many, many lawsuits, on both the state and federal levels, to try to sort this out.
- Scare quotes used because the Constitution does not use either term, and there are significant differences between a criminal conviction followed by a criminal sentence, and what happens during impeachment. See this answer for details. Nonetheless, there are enough analogies to make them useful enough in this context, and besides, the question uses “convict.”