As is true with many subjects, this representation in popular culture does not reflect the reality of exposure to outer space. Ever since humanity first began to probe outside of our protective atmosphere, a number of live organisms have been exposed to vacuum, both deliberately and otherwise. By combining these experiences with our knowledge of outer space, scientists have a pretty clear idea of what would happen if an unprotected human slipped into the cold, airless void.
In the 1960s, as technology was bringing the prospect of manned spaceflight into reality, engineers recognized the importance of determining the amount of time astronauts would have to react to integrity breaches such as a damaged spacecraft or punctured space-suits. To that end, NASA constructed an assortment of large altitude chambers to mimic the hostile environments found at varying distances above the Earth, accounting for factors such as air pressure, temperature, and radiation. Adventurous volunteers were subjected to simulations of the conditions found several miles up, and a handful of animal tests were conducted with even lower pressures.
Using the data from these experiments and their knowledge of outer space, scientists were able to make some reasonable conclusions about how the human body would respond to sudden depressurization. A series of accidents over the years proved most of their extrapolations to be accurate. In 1965, in a space-suit test gone awry, a technician in an altitude chamber was exposed to a hard vacuum. The defective suit was unable to hold pressure, and the man collapsed after fourteen seconds. He regained consciousness shortly after the chamber was repressurized, and he was uninjured. In a later incident, another technician spent four minutes trapped at low pressure by a malfunctioning altitude chamber. He lost consciousness and began to turn blue, but escaped death when one of the managers kicked in one of the machine's glass gauges, allowing air to seep into the chamber.
When the human body is suddenly exposed to the vacuum of space, a number of injuries begin to occur immediately. Though they are relatively minor at first, they accumulate rapidly into a life-threatening combination. The first effect is the expansion of gases within the lungs and digestive tract due to the reduction of external pressure. A victim of explosive decompression greatly increases their chances of survival simply by exhaling within the first few seconds, otherwise death is likely to occur once the lungs rupture and spill bubbles of air into the circulatory system. Such a life-saving exhalation might be due to a shout of surprise, though it would naturally go unheard where there is no air to carry it.
In the absence of atmospheric pressure water will spontaneously convert into vapor, which would cause the moisture in a victim's mouth and eyes to quickly boil away. The same effect would cause water in the muscles and soft tissues of the body to evaporate, prompting some parts of the body to swell to twice their usual size after a few moments. This bloating may result in some superficial bruising due to broken capillaries, but it would not be sufficient to break the skin.
For about ten full seconds-- a long time to be loitering in space without protection-- an average human would be rather uncomfortable, but they would still have their wits about them. Depending on the nature of the decompression, this may give a victim sufficient time to take measures to save their own life. But this period of "useful consciousness" would wane as the effects of brain asphyxiation begin to set in. In the absence of air pressure the gas exchange of the lungs works in reverse, dumping oxygen out of the blood and accelerating the oxygen-starved state known as hypoxia. After about ten seconds a victim will experience loss of vision and impaired judgement, and the cooling effect of evaporation will lower the temperature in the victim's mouth and nose to near-freezing. Unconsciousness and convulsions would follow several seconds later, and a blue discoloration of the skin called cyanosis would become evident.
At this point the victim would be floating in a blue, bloated, unresponsive stupor, but their brain would remain undamaged and their heart would continue to beat. If pressurized oxygen is administered within about one and a half minutes, a person in such a state is likely make a complete recovery with only minor injuries, though the hypoxia-induced blindness may not pass for some time. Without intervention in those first ninety seconds, the blood pressure would fall sufficiently that the blood itself would begin to boil, and the heart would stop beating. There are no recorded instances of successful resuscitation beyond that threshold.
Though an unprotected human would not long survive in the clutches of outer space, it is remarkable that survival times can be measured in minutes rather than seconds, and that one could endure such an inhospitable environment for almost two minutes without suffering any irreversible damage. The human body is indeed a resilient machine.