my DD is 2 months and I discovered (after a couple of bruised aereolas, ouch) that it is either because she needs to be burped or because she's tired and wants to stop eating and go to sleep - she rarely tells me this by actually stopping eating. When she does it, I try putting her up on my shoulder and patting her back, and she'll either burp or go to sleep moments later. Sometimes she continues nursing afterward but often she doesn't.
When I called the Lactation Consultant about it (before I figured it out), she said it could either be that the letdown wasn't happening very fast and the baby was getting impatient, in which case you could try to stimulate letdown before the baby latches on by hand-expressing, or it could be that the milk was coming down too fast and forcefully, causing her to sort of pull away and gag.