Why is the time of useful consciousness only seconds at high altitudes, when I can hold my breath much longer at ground level?
When you are breathing, oxygen ($\mathrm{O}_2$) and carbon dioxide ($\mathrm{CO}_2$) are exchanged between the alveoli in your lungs and the environment. This gas exchange is based on diffusion, which means the partial pressures of each gas involved will move towards equalization:


  Henry’s law states that the amount of a specific gas that dissolves in a liquid is a function of its partial pressure. The greater the partial pressure of a gas, the more of that gas will dissolve in a liquid, as the gas moves toward equilibrium.


(source)

As long as the oxygen partial pressure is higher in the environment, your blood will gain oxygen from breathing. But if the oxygen partial pressure is lower, you lose oxygen from breathing. Therefore, holding your breath at sea level gives you more time until you run out of oxygen than breathing at 15km altitude, where total pressure is about 10 times lower than at sea level. Furthermore, as John K pointed out in the comments, holding your breath at sea level allows you to feel when you need to breathe again, because of increasing $\mathrm{CO}_2$ levels, where breathing at high altitude does not feel different because $\mathrm{CO}_2$ can still leave your system.

This principle also allows oxygen masks in aircraft to function without creating higher pressure. Since (more or less) pure oxygen is created, the oxygen partial pressure is much higher than in the surrounding air despite being at the same total pressure.