There's a simple answer, the heart doesn't have the same type of pain receptors as the muscles, but a fuller answer is much more interesting and shows some surprising gaps in our knowledge.
There are two types of muscle 'pain' associated with exercise. There is fatigue during exercise, and we don't really know what causes that, and there is pain after exercise (DOMS or Delayed Onset muscle Soreness), and we don't really know what causes that! The cause of fatigue is a pretty hot topic. One theory is that it is caused by a problem with the calcium flow inside muscle cells. One of the functions of calcium is to help control muscle contractions. Recent research published in PNAS found that after extended high-intensity exercise, small channels in the muscle cells begin to leak calcium, which leads to weakened muscle contractions. This leaked calcium also stimulates an enzyme that attacks muscle fibers and also leads to fatigue. It is really surprising to me that such a basic phenomenon is still fairly unknown.
DOMS is thought to be caused by a breakdown of muscle fibers and microscopic tears in muscle tissue that occurs as a result of exercise. This typically occurs 1 to 2 days after exercise, particularly if the exercise is new or extreme. There is also evidence that DOMS is more extreme if the muscle movement is eccentric - that is the muscle elongates whilst under tension (eg lowering a weight, starting out with your hand by your shoulder and gradually lowering the weight will produce an eccentric contraction of the biceps muscle).
It used to be thought that lactic acid was involved in both these phenomena but recent evidence suggests that lactic acid may have been unfairly blamed for years and that it may play a more useful role.
In both these cases actual pain is probably caused primarily by swelling which puts pressure on nerves and produces the sensation of muscle pain.
Although the heart does not have the same type of stretch receptor that registers this type of pain it does have some pain receptors. Strangely enough it has the same type of nerve receptors that register the burning sensation from the capsaicin in hot peppers. These are the receptors that are thought to cause the sensation of chest pain from a heart attack. The heart may be less vulnerable to DOMS since it does not undergo eccentric contraction.
All of this is somewhat complicated by the role of the brain. Obviously it is in your interest to stop exercising before damage occurs to your muscles, and, in particular, to your heart. Tim Noakes, a South African sports scientist, has renewed interest in a rather old theory, that Noakes calls the 'Central Governor Model', that the brain is the primary organ that dictates how fast, how long, and how hard humans can exercise.
As you can tell I find this whole intersection of physiology and exercise very interesting. So I have bitten the bullet and next quarter (ie Fall 2009) I will be teaching a CCS class on Endurance Physiology. This will be a seminar format class where we read and discuss papers very much like those listed above and look critically at the evidence for and against various theories and the implications these have for the way people train for what I have generally termed endurance events (swimming, cycling, and running or, for those crazy enough, all three). Loosely inspired by the fact that for the first time in over 25 years Santa Barbara will have a large Marathon event in the fall of 2009.