The jury is still out on what causes stitches but I did hear a suggestion on a Trailplus weekend that they could be caused by a weakness in your core stabilty. Eating too close to running or drinking too much/too little are other suggestions.
I tend to get stitches when my upper body is tense or when not breathing deep enough.
A few (painful) forced breaths later it's usually ok.
And like Ailsa said, when eating too close to running.
I read somewhere that a stitch is actually a small piece of food that gets stuck somewhere in your digestive tract - and once that piece of food has moved, the stitch goes. Not sure how true it is but it kind of makes sense.