It's possible for a U.S. citizen to run for President while in prison, as with Eugene Debs.
Suppose a prisoner runs and wins. Let's also suppose that the crimes in for which the prisoner is serving time for are undisputed and terrible, but for some reason the public generally finds that prisoner better than any alternatives.
Now elected, does the prisoner stay in prison and attempt to fulfill their official duties from a cell (not as unfeasible at it used to be if we permit the usage of computer networking)? Can they pardon themselves and walk free? Would they go on parole for four years?