Side stitches often occur when running but they also can happen when you are working out intensely and breathing much harder than you are accustomed to. It's believed that your diaghram is being "squished" by your organs during the breathing process and often they occur on your right side. Your right side has less room (more larger organs) than the left so you have a lot more "fight" for room in there.
To prevent a side stitch, take even, deep breaths while exercising. Shallow breathing tends to increase the risk of cramping because the diaphragm is always slightly raised and never lowers far enough to allow the ligaments to relax. When this happens the diaphragm becomes stressed and a spasm or "stitch" is more likely.
Here's a link to an excellent resource on side stitches and further methods to alleviate them.
Side Stiches Info