Here is the gist of payback for all the services (hang on it gets a little confusing at points):
You actually incur two active duty service commitments (ADSC's-"payback time"). Everyone on HPSP incurs one three year commitment. This is why, even if you take a two year scholarship, you will serve at least three years. The other commitment is the year-for-year commitment owed for every year that your service pays for med school (ie. four year payback for four years on scholarship)*. But both these ADSC's run concurrently, not additively, so when serving your payback it will equal the larger of the two (ex. three years payback for someone on a two year scholarship with the two year(-for-year) commitment paid off at the same time; four years payback for a four year scholarship with the three year commitment paid off at the same time [hope that make sense])
So when does the payback begin? Depends. If you do a residency (either civilian or military) it will begin after your residency. If you choose to do a General Medical Officer (GMO) tour (which would entail doing a PGY-1 to get licensed followed by a tour as the equivalent of the old "general practitioner") your payback clock will begin ticking after the PGY-1. If that time equalled your (larger) commitment, then at the end, you will have fulfilled your obligation and could choose to get out or you could try for a military residency.
Now here are two more commitments that are incurred: When you do a military residency you incur another three year commitment; and again, this time is served concurrently with the other two ADSC's (so even though a four year scholarship recipient who does a military residency now owes ten years, they will only have to serve four). This only is important to someone who does a GMO tour followed by a military residency (remember the GMO tour will have paid off some or all of their original two commitments, but the military isn't going to train them and let them go immediately afterward. They will owe three years** for the residency [any remainder of the original commitments not paid off in the GMO tour would be served concurrently with the new commitment]) One other commitment that can be incurred is if you get a post-residency fellowship (ex. cardiology). You will incur another year-for-year commitment for the time of the fellowship (I believe that for someone doing a military residency right after med school, it will be additive to the other ADSC's [ie. four year scholarship, followed by residency, followed by fellowship will owe five years payback])
Now a little something specific to the Navy: Many scholarship recipients will have to do a GMO tour whether you want to or not (you can request to do one). This will be determined by the needs of the Navy, but in the Navy this happens the most often vs. other services (it almost never happens in the Army and Air Force for a few reasons outside the purview of this response). This is not Navy bashing (disclosure: I am Air Force). I personally view this as a great opprtunity (I wanted to go Navy but due to an unmotivated Navy recruiter, a motivated AF recruiter, and prior AF service, I went the way I did) as they have some interesting GMO tours such as Undersea Medicine (what I did and still want to do), Fleet Medicine, Fleet Marine Medicine, and Flight Surgeon. To me this is a great way to have some unique experiences while gaining clinical experience before residency (and it allows some people more time to decide what they want to do in residency). Also this is the fastest way to serve your time and get out if you find that the military lifestyle is not for you. So, while some people don't relish the thought of being forced into a GMO tour, it can be a blessing in disguise.
So is this clear as mud? Hope it helped.
*For people with no prior service you actual commitment to the military is eight years. Your ADSC is just that, the time you will have to serve on active duty. But, if you get out after your ADSC is paid off, the remainder of the eight years you will be put in the Individual Ready Reserve (Anybody who enters the military in any position, enlisted or officer, for the first time has this type of commitment). In the IRR you will only be responsible to keep the military informed of where you are and you will be assesed once yearly for fitness for duty. This is in case they need to call you up in some kind of extreme situation. Call-ups from the IRR are rare, but they do occasionally happen.
**I'm not sure, but I think if you do your residency after med school it is the afore mentioned three years. But if you do it after a GMO tour it might be a year-for-year commitment. Check on that. Speaking of checking on stuff: Often recruiters won't know the nitty-gritty of the stuff I just explained. The administrators of your service's program will, though (that's where I got my info; in my case Air Force Institute of Technology staff who administer the USAF HPSP), so don't be afraid to ask to contact them.