It varies widely upon the populartiy of the actor. An actor like Dan Hedaya on Cheers, who 1) established the character and 2) has a very successful career, would probably get thousands or even tens-of-thousands of dollars for an appearance, while an unknown stud who dates Kelly on an episode of Married With Children would probably get a few hundred. There’s also varied rates depending on whether or not the character speaks. Most do receive residuals, and all name-in-the-credits* stars since the early 70s have received residuals. (Residuals are real property, btw, and some actors choose to sell their residuals to companies that purchase intellectual property rights [the same companies that would purchase a songwriter’s catalog, for example]- if you were one of the stars of Angie then this would be a good idea, but if you’re Sally Struthers (who sold her All in the Family residuals, probably not so much- also, I know of at least one actor [Redd Foxx] who lost his residuals in a divorce.)
There was an article in one of the tabloids recently with the (deceased as of last week) actor Kevin Hagen, best known as Doc Baker on Little House on the Prairie. He was lamenting/kvetching that Michael Landon never gave him a contract until the very last season (when the show was known as Little House: A New Beginning, after Landon, Grassle, etc. left the show and Laura became the star). Consequently, he was always pay for play and said he never earned more than $8,000 for a single appearance. He got the standard guest-actor residuals for those episodes and standard star residuals for the last season, but said it only came to a few thousand dollars per year. Had he been a contract player for the run of the show, he estimated he’d have earned well over $1 million in residuals to date.
(Of course when I read this I was thinking "poor guy… you never got more than $8,000 for a week’s work in the 1970s- my mother was a schoolteacher and got less than that for 6 months work and doesn’t receive money today for “being such a damned good teacher 30 years ago”, but…)