If you have knee pain, it could indicate a variety of problems. Your knee pain could be nothing more than transient pain from overuse. Conversely knee pain could indicate something more serious such as a stress fracture or fluid retention. The only way to know for sure what is causing your knee pain is to visit a health care professional and have your knee evaluated, but here are some general guidelines for determining when to just ice your knee and when to stop working out and schedule a doctor's appointment.
Some swelling and inflammation will be present with most knee pain. If your knee swelling is so severe that there is a notable difference in the size of your knees, it could indicate that there is bleeding into the knee joint. Bleeding into the knee joint is a larger cause for concern than just mild inflammation. Bleeding into the knee joint is common with ACL and meniscus tears; both injuries require prompt medical treatment.
The type of knee pain you are experiencing is also very important in determining how concerned you should be. Intermittent knee pain that worsens with activity and feels better after resting, might signal an overuse injury and is less cause of concern than pain that comes on suddenly and doesn't get better. Acute pain could indicate a ruptured tendon or tear, however this isn't always accurate because minor injuries can be more painful that injuries that require surgery.
The location of your knee pain is also important in determining your level of concern--certain knee pathologies are more common in one region and can help you in determining what the likely cause of your injury is. For example, if the pain is localized to your knee cap, the most common injuries are patella tendinitis (inflammation of the patella tendon) or bursitis (swelling of the fluid in the bursa). If your knee pain is on the outside of your knee, it could be an IT band problem.
What you were doing when you started feeling knee pain can give you a clue as to how concerned you should be. If your knee pain has been a sort of nagging pain that you have been experiencing for a period of time, it is less concerning than if your knee locked suddenly while you were running, for example. A sudden locking of your knee could indicate a torn meniscus. A "pop" during activity can indicate a tendon rupture.
The bottom line is that if you are having severe pain, limited mobility, and/or you notice swelling, you should call your doctor right away. It is also important to be evaluated when you are experiencing lesser symptoms of knee pain or ongoing knee problems.