I've seen this subject come up several times even in my short time on K4L, and when I did a search on it the majority of thread titles were questions. A lot of what I'll say below has already been said in different ways in multiple threads, I just thought I'd take the time to condense information and add some of my knowledge and experience.
My background regarding this: I used to be a gymnast (did it for about 5-6'ish years starting when I was a teenager). I've been in touch with my old gymnastics instructor a lot recently on this subject (after a conversation here on K4L ^^), and have checked up some other resources on this as well.
The first rule of stretching is that there is no one way to do it, everyone's body is different from others and needs to be stretched slightly differently. When I use the term "your maximum extension" I mean you as a person in your current state, not the maximum extension your body should
be able to handle eventually. And remember that stretching should feel rather comfortable.
The second rule is that stretching shouldn't really hurt. You have to learn to tell the difference between a muscle stretching and a muscle hurting. And the joints should never hurt, if they are you're doing something wrong.
There are 4 general ways to stretch: Dynamic, Fixed Static, Non-fixed Static, and Ballistic.
You extend a muscle from a relaxed position with a motion, bringing it close to as full extension as you're capable of without
it hurting. Note that you should do the movement on a single line, the only change in direction should be the reversal.
Example: A mae keage is a classic example. You bring the leg up straight as high as you can, without muscles hurting. (Note: Soto/Uchi keage change direction and at the high points you risk pulling thigh muscles if they're not already stretched)
You use something to help you stay in place, most often the floor or a wall, while fixing your body in a certain position. You extend the muscle you want to stretch as far as you can, and hold still a while.
Example: Sit down on the floor, spread your legs wide, and lean forward as far as you can.
You keep a muscle extended in a fix position, but you don't use anything to help you keep it that way.
Example: Perform a slow mae geri jodan (or as high as you reach) and keep the leg in the extended position.
I'm only including this for completion and warning, never ever
Basically you extend a muscle as if you were doing Fixed Static, but when you're at full extension you use gravity and/or body strength to push it further and then let it come back repeatedly, creating a "bobbing" movement to it.
This has been scientifically proven again and again to be harmful for the muscles and tendons since somewhere around the 70's.
The difference between Dynamic and Ballistic: This is a question I often get when talking to my friends about stretching. The difference is that in dynamic you start from rested and reach your maximum extension, while in ballistic you start from your maximum extension and then forcibly move past it violently.
When to use which?
The way I learned it as a gymnast was to begin any training session with some dynamic stretching, the legs/torso/shoulders being the important ones. This is to avoid pulling muscles during warm-up.
After warm-up is done either one of dynamic/fixed static/non-fixed static can be used, most often fixed static is the best choice to let the muscles recouperate a bit. If you want to increase your flexibility, focus on the least flexible muscles during this phase.
How should the muscles feel while extending/extended?
With dynamic you should try and relax the muscle as it is moving. Never try and force the motion to go further than what feels natural, doing that means you risk pulling something. Rather keep doing the motion and it will naturally reach further and further as the muscle starts to loosen up.
With static stretching you should always try and force the muscles to relax as you try to extend them, this is best done in steps. First extend just a bit, stop, tense the muscle for a couple of seconds, then relax and extend a bit more, stop, tense, etc, until you reach your maximum extension. At your maximum extension you can tense the muscles for support or to alleviate the feeling of "stretching". It's only when the muscles are in movement extending that they shouldn't be tensed.
If the muscles hurt during static stretching, tense them, if they still hurt, it means you're extending too far compared to what your body has learned to handle and that you need to back up. Do NOT
bite down against the pain and think that you're drastically increasing your flexibility, you're actually just hurting your muscles & tendons, and you're most likely increasing the time until you actually gain flexibility.
Why am I unable to extend my muscles further?
Your brain is a bit of an a-hole, and as you extend a muscle it shouts out warnings that the movement is going too far and could be dangerous, so it tells the muscle to tense in order to stop it. The whole point of tensing and then relaxing as you're trying to extend the muscle is that if you're consciously tensing the muscle, your brain stops trying to.
Barring injuries there is nothing that physically stops any person from doing e.g. a split. The only thing holding people back is the built-in reflex our bodies have to protect us from overextending.
As your muscles elongate they can extend further before the brain starts to protest.
How should I stretch to be able to kick high?
The most common question people have when they start training karate (that is related to stretching).
I recommend doing the following 3 dynamic stretches before training starts.
1) A modified mae keage, instead of focusing on the form you focus on keeping the supporting leg straight and you don't tense the foot to hit with chusoku. The angle between the legs is the important part.
2) Yoko keage. Again, keep the supporting leg straight, the angle is the important part.
3) "Ushiro keage". Basically a keage made backwards. Brace yourself on something (e.g. a wall) with your hands and lean a bit forward, then kick back with a straight leg while keeping the other straight.
Do these until the movement feels "frictionless" at around your maximum extension. This can mean up to or above 30 times per leg per direction (90 in total for each leg) in the beginning. Be warned though that it's rather taxing on the endurance of the legs, so don't overdo it right before a training starts. As you start doing it more often you get down to about 10 times per leg per direction, but remember to still not force the legs too high too quick.
Just having done this, try to slowly and without force or snap to kick high, you'll be surprised at how smooth you can reach your usual height just from doing this.
Most trainings include static stretching (and if your's doesn't just do it yourself at the end). During that you should not
try to push all your leg muscles to elongate, always go for the weakest link and focus on that. There are some different reasons for this, but mostly it's because you want the others to help support the leg while the strained one recuperates.
For most people it's the hamstrings (the backside of the leg, from hip to heel) that are the most inflexible. To stretch these specifically, sit down, spread your legs (but comfortably, not as far apart as you can), and then lean forward over one leg at a time statically stretching it. When you start to be able to reach them you can grab your toes (from above, not from the side) and pull them backwards, this helps pull on the hamstring.
If your inner thigh muscles are the most inflexible ones, sit down and put the soles of your feet together and then let your knees fall to the sides. Do the tensing/relaxing of the muscles and use your hands or elbows to try and force he knees further down to reach your maximum extension.
If the front/side muscles are the least extendible (unusual, but could happen), there is a great fixed static stretch for that. Stand on one knee (as if you were to propose) but with the front foot quite a bit forward, bend your body forward (put your opposite hand next to the forward foot for balance), grab the back leg's ankle and try to bring that heel to your butt. To increase the extension (when necessary) you press the hips forward towards the floor.
I tried to add the general questions along with answers, if I missed one feel free to ask it and I'll add it.
It became quite a wall of text, so if I made a mistake somewhere or contradict myself, please point it out so I can correct it.
Comments and feedback is as always very appreciated!