What the Muslim is obliged to do is to offer the prayer on time and not let himself be distracted from it by anything, unless it is something urgent that he cannot do anything about, such as saving a person from drowning or rescuing people from a burning house, or warding off the attack of an enemy that is feared. In such cases there is nothing wrong with delaying the prayer for that reason, even if the time for the prayer ends. But with regard to ordinary matters in which no danger is involved, it is not permissible to delay the prayer because of them.
It is proven that the Prophet (blessings and peace of Allah be upon him), when the people of Makkah besieged Madeenah on the day of al-Ahzaab, delayed Zuhr and ‘Asr prayer until after Maghrib. According to another report, he delayed ‘Asr prayer until after Maghrib, because he was preoccupied with fighting. It is also proven that when the Sahaabah besieged Tastar, dawn came when the fighting was still going on and the people were scaling the walls and were at the gates of the city, and they delayed Fajr prayer until conquest was granted to them, then they prayed at the time of duha (forenoon) so that they would not miss out on the opportunity to conquer the city. In such situations it is permissible to delay the prayer. If there is a fire in which Muslim people are trapped, it is permissible to focus on rescuing them, even if that means that you will miss offering a prayer on time, because saving Muslim lives which are protected by sharee’ah is very important, and because it may not be possible to deal with this danger except by delaying the prayer; the prayer is being missed for a valid reason, so it is permissible to delay it. A person may also delay the prayer and join prayers because of sickness and travelling, so it is permissible to delay prayers until after their time or to delay ‘Asr or Fajr prayers from their times in order to save one who is drowning or burning and so on. End quote.
Shaykh ‘Abd al-‘Azeez ibn Baaz (may Allah have mercy on him)