I can't stress enough how important warming up and stretching are to your overall fitness routine, but a lot of people completely ignore these key steps to overall success.
Warm-up
Always begin any exercise session with a gradual warm-up. This can be any sort of cardiovascular activity such as jogging, jumping rope, or using an elliptical machine. The purpose of the warm-up is to prepare your body for more intense exercise by warming up the muscles and joints by getting your heart rate up and your blood flowing. This greatly reduces the risk of injury by avoiding sudden shock to your system because you aren't just instantly throwing yourself into an intense workout. Remember, this is just a warm-up so take it light. You don't want to tire yourself before you even get into your main workout. 8 - 10 minutes of warm-up to break a light sweat will suffice.
Stretching
Save your stretch session for after your workout. A few quick targeted, more "dynamic" stretches are fine for after your warm-up, but after your workout you should really focus on long, prolonged stretches. When you stretch you want to ease into the stretches slowly and gradually until you feel a slight burn. Never force or bounce your body into a stretch. That pain you feel is due to a response from what are called Golgi tendon organs. They cause a reflex to oppose muscle contraction to avoid injury due to a sudden stretch in your muscles, but it can be overcome if you ease into the stretch. In general, you should hold each stretch for at least 30 seconds, and as long as 60 seconds the older your get. The first 10 seconds involve the muscle simply adjusting and relaxing, during the next 10 to 20 seconds the muscle is actually stretching, so don’t rush it. Some studies suggest that stretching after a workout can increase overall strength gains by nearly 20%! Make sure you stretch your entire body after your workout, even if you only worked out a specific body part.