For how long do the oxygen masks work?
The oxygen level and the pressure inside the plane are supported artificially. If the cabin is depressurized at a great height, people start having hypoxia: they lose consciousness and can die without an oxygen mask.
Oxygen masks can work for 10-15 minutes. This is enough time for the pilot to bring the plane down to an altitude where you can breathe normally. Pilots have their own oxygen masks that work for a longer period of time. This is because they need to be able to land the plane without losing focus. Prior to every flight, pilots check that their masks operate properly.