Republican incumbent Abraham Lincoln vs Democrat George McClellan
Edit - The question asked for the names of the parties on the ballot, not the names of the candidates.
For the purposes of the 1864 Presidential election only, the Republican Party changed its name and was referred to on the ballot as the National Union party.
While it is not uncommon nowadays to hear references to the Democrat Party, in 1864 it appeared on the ballot as the Democratic Party (and its official name is still the Democratic Party). My research indicates that it didn't begin to be referred to as the Democrat Party until some time in the 1940's.
hoosier