there are emergency oxygen maske which last only for about 30 minutes. in the meantime , the aircraft imm. contacts the nearest possbile atc tower and prepares for emergency landing.some long distance flights have oxygen for an hour or so. but by such time they land the aircraft. but actually in the recent past we have never heard of such an emergency situation.
Your vote on this answer has already been received
The cabin is pressurized in such a way that it does not effect human beings in the normal course. In an emergency the oxygen mask will automatically drop down and it can be used, i am not aware of the length of time the supply would last. Hope nobody experiences this kind of situation. God Bless!!