I receive many requests from my students for letters of recommendation. Writing letters of recommendation is a part of my job, and one that I take seriously. It is my job to help my students succeed.
I can respond most effectively if you provide me 2 or more weeks notice prior to my having to submit the letter. With less notice I may not be able to provide the letter (and more notice is always better - I'm occasionally in the field or consumed by other duties and unable to process recommendation letters even in 2 weeks). When you request a letter from me, please provide me detailed information about what you are applying for, along with as much of your application information as possible (for example, a draft of application essays or cover letters, a CV or resume).
Note that if you are are a graduate student applying for an academic job, there is a quirk in many university HR systems that means you may be asking me for letters without realizing it. Specifically, many university HR application websites will ask you for "the names and contact information for three references" or something along these lines, implying that they will only ask for references from short-listed candidates. However once you enter this information, a request for a letter of reference is sent to me automatically. This request often contains no information about what position you are applying for. So please tell me when you are listing my name as a reference, even if you don't think I will be contacted. And please provide me with details about these applications too!
If you want me to write a strong letter for you, please read Leonard Cassuto's wise advice - all of which applies to me as well as to him. Please include this information. This advice applies each time you request a letter, unless the letters are very similar or are in very close succession - if you sent me all of this information when you requested a letter a couple of months ago, send it again this time too. This will help me personalize your letter, which will make it more effective.
In general, I do not provide letters to students to submit with their applications. In nearly all cases that I am aware of, employers, graduate schools, and fellowships provide faculty instructions for how to submit their letters directly to the reviewers. Please provide me with this information.
Finally, if you only know me from taking one of my larger lecture classes, keep in mind that I probably do not know you very well, and you are almost certainly better off asking for a letter from a professor who knows you better, and will thus write a more detailed and personalized letter. Letters I write for students who I only know because they got an A in a class with 120 students are of necessity brief and formulaic . This kind of letter is not very effective support (worse if only know you because you got below an A in one of these classes, in which case I really don't feel comfortable providing a letter). If you want strong letters of recommendation it is imperative that you get to know professors by finding a way to work closely with them.