Letters of recommendation
Generally it is good form when you ask a professor to write you letters of reference to ask several weeks and ideally a month in advance. The odds are that you are not the only student requesting letters of recommendation from this professor at that time and professors frequently travel and may be out of contact for long periods of time. It is also good form to wait submit the professor's name until after you have gotten a reply from the professor stating that he or she is willing and able to write a letter of reference. While you may not start filling out the detailed application that far in advance, you usually know that you will be applying well before the deadline. You do not have to specify which programs you will be applying to when you ask a professor to write you a letter of recommendation - you can just say, for instance, that you will be applying to summer undergraduate research programs. It is normal for students to apply to several programs and while the letters may be individually tailored, it is not significantly more work to write five letters for a student than to write one. It is also a good idea to tell the professor about the program(s) you're applying to, particularly if it is outside of the professor's field and/or not academic. For instance, if I know that you're applying for a scholarship targeted at students with an interest in ichthyology, I can write a letter more appropriate for that scholarship.
For most programs (graduate school, undergraduate research, scholarships, jobs) you will need three letters of reference. You should think through which people should write your letters in advance. I would be glad to give you advice on this during office hours. You can plan in advance and try to cultivate people who can write you letters of reference. I am in a better position to write letters for students I have substantial contact with. That can be difficult if you are mostly in large classes, but every semester I get to know some students fairly well. I remember students who show up regularly to office hours and speak up in class and on the discussion forum more frequently. In a large class like this I also frequently ask my teaching assistants about students before I write letters, since they may get to know you better. For some purposes, teaching assistants can write letters of reference and a good letter of recommendation from a teaching assistant who knows you can be more effective than a pro forma letter of reference from an instructor you may have never spoken to. Keep in mind that most teaching assistants have never written a letter of recommendation and would need some coaching.
If you would like me to write you a letter of reference, I usually ask for a current copy of your resume or CV so that I can be sure to get facts right. While I usually recognize my students' names even years later, it is a good idea to remind me what class you took with me and what semester you took it, particularly if it's been a while. Please try to give me at least two weeks advanced notice, please tell me about what you're applying to, please attach a current copy of your CV, and please wait until I reply to list me on any forms. I usually tell you when I've submitted the letter so if it gets close to the deadline and you have not heard from me, by all means send me a reminder.