During the Space Shuttle program, 69% of male astronauts and 55% of female astronauts reported headaches during short missions. For long duration missions onboard the ISS, about 70% of astronauts report headaches.
For short missions, the headaches are often attributable to space adjustment sickness. It takes a little while for the body to adjust to the dramatically different environment.
There are a lot of variables that can increase the likelihood of headaches and space likes to bring those in spades.
Microgravity results in fluids being evenly distributed throughout the body instead of pooling in the lower body, as they do on Earth. This means that astronauts have more fluid floating around in their head than we do on the ground. This can cause congestion and pressure that can induce headaches. That pressure also can affect the shape of the eyes, changing the astronauts’ eyesight, which can cause headaches.
The sensation of thirst doesn’t work as well in space. Astronauts are told not to wait until they feel thirsty to drink. But sometimes they get busy and forget. Dehydration can trigger headaches.
The atmosphere of a spacecraft tends to have a higher concentration of carbon dioxide (CO2) than the air we breath on Earth. For every mmHg of partial pressure increase in carbon dioxide, the likelihood of headaches doubles.
Spacecraft are noisy. There is no natural convection in space, so to encourage heat transfer and air circulation, there are many, many motorized fans. Each of those makes noise. Add to that the pumps for coolant, and other mechanical noises and headaches can result.
Stress can be a trigger for headaches. Space is hard. It’s stressful to be responsible for a multi-billion dollar international resource. It’s stressful to be away from family for six months.