The Rishonim disagree as to whether there is a biblical commandment (mitzvah m’d’oraita) to pray every day. According to the Rambam (Sefer HaMitzvot, mitzvah 5), there is a biblical commandment to pray daily, as it says (Exodus 23:25), “Serve God your Lord,” and (Deuteronomy 6:13) “Remain in awe of God, serve Him.” Although these verses contain a general commandment to serve Hashem, they also include a specific commandment to pray. The Chachamim interpreted ‘service’ (avodah) to mean prayer, as it is written (Deuteronomy 11:13), “Love God your Lord and serve Him with all your heart,” and they explained (Ta’anit 2a), “What is serving with the heart? You must say, [it means] prayer.” By praying once a day, a person fulfills his biblical obligation to pray. To fulfill one’s obligation, one must commence his prayer with praise to Hashem; after that ask for what he needs; and conclude by thanking Hashem for the good He has bestowed upon him. The Torah does not specify how long one’s prayers must be. Therefore, some shorten their prayers and others lengthen them, yet they all fulfill their biblical obligation (Rambam Tefillah 1:2-3).
However, according to the Ramban (Hasagot on Sefer HaMitzvot), there is no biblical obligation to pray every day, because, in his opinion, the extrapolation from the verses that the Rambam mentions is not complete, but rather only an asmachta (reference). Anshei Knesset HaGedolah instituted the daily prayers. Only during times of trouble is there a biblical commandment to pray to Hashem, as we learn from the mitzvah of the trumpets (chatzotzrot), where it says (Numbers 10:9), “When you go to war against an enemy that attacks you in your land, you shall sound a teruah (short blasts) on the trumpets. You will then be remembered before God your Lord, and will be delivered from your enemies.”
Hence, according to all opinions, there is a biblical obligation to pray in times of trouble. Therefore, anyone who finds himself, or his friend, in a state of crisis is required to add a special request for assistance in his prayer, since it is a biblical commandment to pray to Hashem that He save him from that trouble. All the more so when the public or the nation is in danger; it is a mitzvah for the tzibur (public) to pray a communal prayer; Chazal even instituted fast days for that reason.