Hypoxia
Without atmospheric oxygen, the brain loses usable oxygen and consciousness fades in seconds. This is the first lethal clock.
Earth & Space
The answer is both better and worse than the movies suggest. Movies show exploding heads, instant freezing, boiling blood, and eyes popping out. Real vacuum exposure is less theatrical but still lethal. The strangest part is that you would likely remain conscious for about 9-15 seconds. Space exposure is a race between hypoxia, decompression, ebullism, radiation, and heat loss, and the first hazard is not the one most people expect.
Quick answer
Removing a helmet in space would cause loss of consciousness in roughly 9-15 seconds from hypoxia. You would not explode or freeze instantly. Exposed moisture would vaporize, gases would expand, and survival might be possible if repressurized within about 90 seconds. Soyuz 11 and a NASA vacuum-chamber accident provide the grim real-world evidence behind the survival window.

The short answer
Removing a helmet in space would cause loss of consciousness in roughly 9-15 seconds from hypoxia.
Hypoxia
Without atmospheric oxygen, the brain loses usable oxygen and consciousness fades in seconds.
Curiosity twist
Soyuz 11 and a NASA vacuum-chamber accident provide the grim real-world evidence behind the survival window.
Common mistake
The pressure difference would make the body explode.
Next tiny mystery

Earth & Space
Another big-question explanation in the same collection.

Earth & Space
Another big-question explanation in the same collection.

Earth & Space
Another big-question explanation in the same collection.