Chest pain during exercise can come from your heart, or it can come from structures surrounding your heart. It can be extremely difficult to tell if a particular pain is originating from your heart or from somewhere else, and true heart pain during exercise is a life-threatening emergency until proven otherwise, so it's important to be seen by a medical professional as soon as possible if you're having heart pain during exercise.
When people say they're having "heart" pain, they usually mean they're having some sort of abnormal sensation in the middle of their chest, where they know their heart is located. True "heart" pain typically occurs when the heart tissue is not getting enough oxygen to meet its metabolic needs. However, mid-chest pain, even during exercise, doesn't always come from the heart. A short list of things that can cause non-heart pain that people may mistake for heart pain would include anxiety, musculoskeletal pain, acid reflux and pulmonary embolism (a lung condition). Of these, anxiety, musculoskeletal pain and acid reflux are more common than true heart pain (although they may not be as likely to present themselves during exercise). The key to determining what kind of pain you're dealing with lies in how the pain presents itself.
True Heart Pain
True heart pain resulting from exercise typically has several of the following features: It is located in the mid-chest (substernal, in medical lingo); it has a "squeezing" or "pressure"-like component to it; pain may radiate to your jaw or down both arms (the left arm is more common than the right); in the context of exercise, it will come on with increased activity, last for several minutes (at least) and (hopefully) ebb with rest; and it may be associated with a feeling of weakness, nausea or sweating.
Other Chest Pains
For comparison, musculoskeletal pain, which can also occur during exercise, is usually not substernal, comes on very quickly, resolves itself quickly and is frequently described as "sharp, shooting pain." Musculoskeletal pain is usually quite localizable, whereas heart pain is less so. Reflux and anxiety are less likely to surface during exercise, but reflux typically manifests as substernal chest pain accompanied by a burning sensation in the back of the throat that is worse after rich meals and when lying down. Anxiety attacks can seem very similar to true heart pain, but are typically associated with anxiety-provoking situations (not usually exercise), are accompanied by a feeling of panic or doom, and ebb when you exit the anxiety-provoking situation.
True Heart Pain Causes
The most common cause of heart pain is a condition called atherosclerosis, in which fatty plaques build up in your coronary arteries, hindering the delivery of blood and oxygen to your heart. When your heart gets to beating rapidly (as happens with exercise), its demand for oxygen goes up. The only way the heart can get more oxygen is to increase blood flow to itself. However, if its arteries are too occluded by atherosclerotic plaques, increasing blood flow to an appropriate level is impossible, and the heart becomes relatively oxygen-starved. This manifests as heart pain.
Heart pain during exercise is an emergency until proven otherwise, and if you're having heart pain during exercise, you should be seen by a medical professional immediately. Heart pain can be something called "angina," which means your arteries are partially occluded by atherosclerotic plaques, but not so much as to cause permanent damage to your heart tissue, or it can be something called a "myocardial infarction"--or heart attack--in which heart tissue is permanently damaged. Angina is a warning sign telling you that you need lifestyle (and possibly medical or surgical) intervention to remain healthy; a heart attack can kill you. Other less-common causes of heart pain during exercise include several inherited diseases that affect how well your heart muscle contracts.