The following is assuming a traditional application year with both taking the MCAT and applying to medical school in the summer.
By January of application year you should have a pretty good idea of whom you would like to write your letters. You want some variety here. You will do just fine with approaching two science professors, one non-science professor, a research professor if you did any, an MD you worked with or shadowed with, and a prior military commander. I had 5 letters: 2 science professors from the U of AZ, 1 non-science professor from my business undergrad, 1 letter from my former RQS commander, and 1 letter from our flight doc who was assigned to my RQS for the 4 years I was there.
Approach your letter writers in the late fall/early spring for the cycle you need your letters by. For example, I applied to medical school in the 2011 cycle. This cycle opens in May 2010. All of my letters were uploaded by June. For my professors, I initiated my request with an email followed by a personal visit to their office. I also had a draft of my personal statement, my academic resume, and a personal letter letting them know what I was currently working on in school/work/life, my time lines, goals, and my appreciation for them taking their time to help me.
I made a point to really get to know my professors prior to asking them. I participated in class and made office hour visits when I had them as my professor and I even TA’d for one. I felt that they had a good idea of “who I was” when I asked them. I still keep in contact with them even though I moved out-of-state. For my previous commander and flight doc, I called them and asked them over the phone. I then sent the same documents to them via the US mail; just as a courtesy.
When applying, make note that each school is different, check the school’s website and check the MSAR book. Schools are flexible. Email them!!! Some will say they require 3 letters and have “no limit” while others will accept only three and have specific requirements, i.e. 2 science professors and 1 non science. Some expect to see the letters with the primary application; others don’t read the letters until the secondary application. Some schools only want 1 or 2 letters so you have to decide which letters from whom will go where. AMCAS makes this very easy for you to select what letters you want sent to what school.
Also, you don’t have to have all your letters submitted before you electronically “submit” your application. You want to submit your application as soon as possible. AMCAS will take two weeks to review it and you can make sure your letter writers upload their letters within that time. DON’T DELAY SUBMITTING YOUR APPLICATION BECAUSE YOU ARE WAITING ON A LETTER!