Praise be to Allah.
Salaat al-Haajah is not prescribed in sharee’ah(Ibn ‘Uthaymeen, Fataawaa Noor ‘ala’l-Darb, 1/169). Imaam al-Tirmidhi (may Allaah have mercy on him) narrated a hadeeth about Salaat al-Haajah in his Sunan, but he pointed out that it is da’eef (weak). He said in the chapter on what was reported concerning Salaat al-Haajah: “’Ali ibn ‘Eesaa ibn Yazeed al-Baghdaadi told us, ‘Abd-Allaah ibn Bakr al-Sahmi told us, and ‘Abd-Allaah ibn Muneer told us, from ‘Abd-Allaah ibn Bakr from Faa’id ibn ‘Abd al-Rahmaan from ‘Abd-Allaah ibn Abi Awfaa who said: ‘The Messenger of Allaah (peace and blessings of Allaah be upon him) said: “Whoever has any need of something from Allaah or from any of the sons of Aadam, let him do wudoo’ and do it well, and pray two rak’ahs, then let him praise Allaah and send blessings on the Prophet (peace and blessings of Allaah be upon him), then let him say: ‘La ilaaha ill-Allaah il-Haleem il-Kareem. Subhaan-Allaahi Rabb il-‘arsh il-‘azeem. Al-hamdu Lillaahi Rabb il-‘Aalameen. As’aluka moojibaat rahmatika wa ‘azaa’im maghfiratika, wa’l-ghaneemata min kulli birrin wa’l-salaamata min kulli ithmin. Laa tada’ li dhanban illaa ghafartahu wa la hamman illaa farrajtahu wa la haajatan hiya laka ridan illa qadaytahaa, yaa arham al-raahimeen (There is no god but Allaah, the Patient, the Most Generous. Glory be to Allaah, the Lord of the Mighty Throne. Praise be to Allaah, the Lord of the Worlds, I ask You for Your mercy and forgiveness, for help to do all good deeds and for protection from all sins. Do not leave for me any sin but You forgive it, any worry but You relieve it, or any need with which You are pleased but You meet it, O Most Merciful of those who show mercy).’”’”
Abu ‘Eesaa (i.e., al-Tirmidhi) said: “This is a ghareeb hadeeth. The fact that Faa’id ibn ‘Abd al-Rahmaan is among the narrators makes the hadeeth very weak. Faa’id is Abu’l-Warqaa’.”
Al-Albaani said: “It is very weak indeed.” Al-Haakim said: “Fabricated ahaadeeth were narrated from Ibn Abi Awfaa.” (Mishkaat al-Masaabeeh, 1/417). This hadeeth was also narrated by Ibn Maajah, may Allaah have mercy on him, in his Sunan, 1/144, also via Faa’id ibn ‘Abd al-Rahmaan. Al-Albaani said, in Da’eef Sunan Ibn Maajah, no. 293: “(It is) very weak.”
On the basis of the above, this prayer is not prescribed in Islam, but if the Muslim is faced with distress, he should pray and make du’aa’ in general (with no restrictions as to a certain number of rak’ahs or a specific du’aa’ that is not proven in sound ahaadeeth, etc.), because Allaah says (interpretation of the meaning): “And seek help in patience and prayer…” [al-Baqarah 2:45], and because of the hadeeth of Hudhayfah in which he said: “When anything distressed the Prophet (peace and blessings of Allaah be upon him), he would pray.”(Reported by Abu Dawood in his Sunan, 1124, and classed as hasan in Saheeh al-Jaami’, 4703).
And Allaah knows best.