I used to think this question was a bit ridiculous. The volume of air that we take in while breathing may be high but the lungs only consume 25% of the oxygen for any breath and the rest is returned. Closing the windows while sleeping in a room or sleeping in a closed tent does not affect one's breathing. (At least, it never did for me and I have never heard of such a case.)
However, when I tried my new bivouac sack (measures 2.1 m long, 66 cm wide, 50 cm high) last weekend there was a point during the night where I experienced some unrest. I could not sleep (which is not that unusual when it is cold) but also my breathing became very heavy and shallow. More surprisingly, when I opened the bivouac sack's door, the breathing relaxed immediately. I did some background research on this and from this calculation, it seems that humans consume one cubic meter of air in half a day. So if we break this down to a quarter cubic meter for 6 hours of sleep, it might come close to the volume of air that was available in the sack. (But then again I still can't believe it.)
In the end, I left the door a bit opened for the whole night. However, I do not think this is solution will always work.
Now I wonder, was what I experienced mainly psychological or are oxygen shortages while sleeping in a bivouac a real thing?
Additional background that may or may not inform answers to the question: The temperature was about 0 °C (32 °F), the air was humid (rather foggy, close to a river) and the elevation was at 500 meters above sea level. I went to stay in the bivouac at 7 pm, the breath shortages occurred, I think, around midnight.