Let's say a person's hair was on fire and suddenly we (instantaneously) pumped all the air out of the (sealed) room, then after time period X we put all the air back. Is there an X such that we will put out the fire (and it won't start again), but we won't kill the person? What's the approximate value of X?
@AMCDawes gives a well reasoned explaination of how the physics would play out.
However in the scenario depicted by Dawes, he leaves out the part whereby we reintroduce the poor hapless subject to air (I assume 20% oxygen @ STP).
If we duty cycle this quickly enough the hair would definitely reignite *.
The issue is that flammable substances have a temperature called Autoignition temperature. At this temperature, as long as there is oxygen, the substance will spontaneously combust.
So if the hair was above the autoignition temperature, then by reintroducing the subject to air, his hair will reignite.
So to determine how long is needed, we would need to calculate how long it would take to significantly cool the hair below the autoignition temperature.
Hair is long and thin, therefore it can conduct heat away from itself relatively easily. Assuming a vacuum it would need to radiate the heat away. This process is going to take a LONG time, so no....the subject is likely to expire before that happens.
HOWEVER. Final point. During the initial decompression event, the air around the hair must be moved, to be REMOVED. Assuming a explosive decompression event, winds should be generated ~300m/s.
Citing birthday celebrations as empirical evidence and that 7 year olds do not have transonic breath, the wind generated by the decompression event should be enough to extinguish said flames by thermal conduction (and not by removal of the oxidiser).
*Please do not attempt this on live humans, Nazi Germany once did this please use that data instead.
For the sake of answering your question as asked, we'll assume you can in fact pump out all the air in the room instantaneously. By "all the air" we'll assume we can drop the pressure to something quite low but not ultra-high-vacuum. Two scenarios suggest that this would work: The first is the fact that humans have survived at near-vacuum conditions for up to 30 seconds. One case of this can be seen in this video: https://www.youtube.com/watch?v=KO8L9tKR4CY
The second is that a candle will go out within about 5 seconds of starting to evacuate a bell jar: https://www.youtube.com/watch?v=r8ybzS_zvgg
Taken together, these two pieces of evidence suggest that a human could outlast the extinguishing process. A remaining question is how the candle scales to a human head of hair (no videos available on youtube for this!). Given the chemical process is quite similar, it is reasonable to use the candle as a model for burning hair; they both require oxygen, if anything, the hair (as a larger fire) actually helps evacuate the chamber by consuming some of the oxygen as it burns.
Finally, the real question is about how fast you could pump out the air in the room. This is not trivial given the size of a standard room. In the first video you can see the general amount of equipment required to evacuate even a small person-sized test chamber.
Is the vacuum a required part of the problem? The available action time is increased if it were only oxygen suddenly removed, baring panic. The best case scenario with planning and specific conditions met is about 20 minutes, http://www.guinnessworldrecords.com/world-records/1000/longest-time-breath-held-voluntarily-(male) (Out of water the max time is halved. Generally most people can do a minute to three.) This person would then be limited to the time of inset of shock. For a person with a high pain threshold, this could be limited to shock caused by loss of fluids.
This article http://en.wikipedia.org/wiki/Space_exposure suggests you only have about 14 actionable seconds in a space vacuum but longer with aide.
Thinking outside the box and without standard fire suppression materials, you would need a nearby object that condensed a significant amount of ambient moisture as a result of decompression/compression, or a heat superconductive hat. Mentioned in another post, heat is going to be a killer.
If you take the physics problem out, you have the biological problem that the existing burn is still continuing to cause damage for several minutes even after visible combustion has been snuffed out. Some damage is due to residual heat and some of it is due to the body's reaction to the injury. (When you burn your finger cooking, you put it in cold tap water for a few minutes to avoid blistering.) The Merck Manual states burn symptoms can worsen hours and days after a burn. http://www.merckmanuals.com/home/injuries_and_poisoning/burns/burns.html
To answer the question: a mortal active hair burn does not have enough time to allow survival by decompression, explosive or otherwise, unless the residual heat problem is managed.