Most people who work out have their routine timed down to the minute. But because they are often working out in the midst of a busy schedule, they don't always take the time to warm up or cool down before and after their workouts. However, the few minutes it takes to do so are very important for one's physical conditioning. In order to better understand the process, Habs Director of Sports Science and Performance, Pierre Allard, explains the usefulness of warm ups and cool downs and offers up some suggestions on how to incorporate stretching into your routine.
I often tell the players that I view them as sprinters on ice; they have to be ready for a sprint on their skates at any moment. It's the same thing for the average joe, when they go to work out and they're not properly warmed up, they're at a higher risk of getting hurt. In their case, even if they only have 20 minutes to work out, I would prefer they spent that whole time on warm ups rather than having them lift weights cold. You can't go into a workout unprepared.
As proof that it's important, take the example of real sprinters, who spend more time warming up and cooling down than actually working on their speed training. That said, I don't tell people they should be spending 40 minutes warming up! At the very least, they should make sure to get their body temperature up, especially the parts that will be exerted during the workout. The following photos are examples of several exercises that you can do before or after your workout in order to prepare your body for what's to come.
It's recommended to stretch at the end of our workouts because that allows us to rest up and return to our normal rhythm. The endorphins that are secreted allow us to do it at our own pace and to take advantage of the moment to work on our body. Still, it shouldn't be painful; warmups and cooldowns are not supposed to hurt.