Could I ask a recommendation letter from a professor who left the university? One of my friends had a pretty good relationship with their undergraduate professor; however, the professor decided to retire and no longer teaches at that university. In a few months, my friend is deciding to apply to graduate school, and he is wondering if it would still be appropriate to ask his retired professor to write him a letter of recommendation?
If the faculty is retiring to emeritus status then they can still write on letterhead. Many emeritus still maintain an active research profile or use the time to write, but in any case they might be willing to write for you. Many enjoy keeping one foot in the teaching/advising world. 

There's nothing to be lost by asking. 

And from the perspective of people on admissions committees, a strong letter from an emeritus faculty who compares this student against their thirty or forty years of other students can be very persuasive.