This has been previously touched on here: “Commentor” vs “Commentator”. I'll try to expand on that.
Both -er and -or are so-called "agent noun suffixes", and Wiktionary has entries for both:
Generally speaking, -er is much more common in English (which should come as no surprise since it has deep Germanic roots, see the link) and can be easily attached to any English verb to form the corresponding noun (drive — driver, run — runner, drink — drinker, etc.).
The suffix -or, on the other hand, comes from Latin, and is used much more seldom, basically where Latin would do it. Just try building the words drivor, runnor or drinkor, and see for yourself. In fact, Wiktionary lists only a handful of terms that were derived using this suffix, such as actor, author and sculptor, and goes on to provide the following usage notes:
English generally appends this suffix where Latin would do it—to the root of a Latin-type perfect passive participle. For other words, English tends to use the suffix -er. Occasionally both are used (computer vs. computor).
Etymonline has additional info on the origin and usage of -er and -or.
Edit: courtesy of Martha, here's a link to a post on the "Separated by a common language" blog that provides further details and addresses the differences between US and UK English:
The -or suffix is primarily found in words derived from Latin, whereas -er can be put on the end of just about any verb that involves an agent (a 'doer' of the 'action'). But Latin-derived words differ in how strongly they are associated with the -or suffix. Latin-derived verbs that end in -ate, for example, almost always take the -or suffix. So we have dictator, but not a variant dictater, alternator but not alternater.
Things are less clear-cut with other Latin-derived verbs. For example, in my job, I advise students and convene courses, and when I spell out those roles, I'm an advisor and a convenor, but when my UK university spells them, I'm often an adviser (which just looks wrong to me) and a convener.
[...] The -or form is stronger in the US than the UK, though there's considerable variation within each country.
Best Answer
It comes from Latin successor, which means roughly the same. The verb comes from succed-o, which also means roughly the same.
The root of the Latin verbal stem ced- ("move away, cede") is the Proto-Indo-European root
*ke-
, "here, this" (deictic/pronominal stem), plus*s(e)d-
, "sit, set, settle" (compound*k̂e-zd-ō
)—so says the Oxford Latin Dictionary (1982): Pokorny and Ernout (1959) are unclear.The prefix sub-, "from under", is added to form the meaning "to go sit/move from under" for succedo, if you will forgive me this awkward translation. It is a phonological rule in Latin that -bc- is normally assimilated into -cc-.
The supine stem of a Latin verb—the stem used to make past participles—is normally formed by adding -t- to the verbal stem:
*cedt-.
Phonology demands that -dt- (and -tt-) at the end of supine stems normally change into -ss-, hence the supine stem success-. The past participle is successus, roughly "succeeded".The suffix -or is used in Latin to make an agent out of a verbal stem, just as in English -or and -er: hence Latin successor, "successor".
In English, we sometimes borrow words from Latin directly, or from Latin through French, like successor, while at other times we only borrow the verb and make our own agent word, like revoker (instead of revocator). But we usually use the Latin noun if you also use the Latin verb: proceed, processor; permit, permission, etc. etc.; sometimes we use both, as in merge, merger, immersion.