Free or nearly-free electrons on stuff like wool are getting rubbed off onto you so that your body holds some sort of net total electric charge. When you touch a metal door (or any piece of metal) then the electrons want to spread out to balance themselves between you and the metal. Since the metal conducts electricity very well, they fly off you very quickly which heats up the air in between you and the metal, giving you the painful "shock" feeling.
Wood won't uncharge you very well, since it doesn't conduct electricity very well. The only ways to prevent getting shocked are either not building up charge in the first place, or constantly touching metal so that the charges get released way before they can build up - in effect spreading out your shocks to many smaller shocks you can't feel.
There are many ways to build up a static charge, but it is generally much, much easier when the air is dry. Since cold air is drier, this means you probably build up a charge more quickly in the winter.
As for how you build up charge in the first place, it is usually by rubbing certain materials together. Plastic or rubber rubbing against wool carpeting or clothes (or any sort of hair) will do it, which is the most common cause for people in their day-to-day lives. If you want to stop it, you could consider using dryer sheets, which use a substance which happens to be conductive to soften your clothes - this makes you constantly discharge as you touch your own clothes, so you achieve the "many tiny shocks" method alluded to above. Or, you could use a humidifier in your home, which adds water to the air, making static much harder to build up.