When Was Surat al-Fatihah Revealed?
Question

When was Surat al-Fatihah revealed? Was it revealed after Allah enjoined the prayer upon people, or before that? I would like to know when that happened.
Praise be to Allah.When was Suat Al-Fatihah revealed?
Surat al-Fatihah is one of the Makkan surahs [i.e., revealed during the Makkan period, before the Hijrah], according to the majority of scholars. The scholars quoted several things as evidence for it being classified as Makkan, including the following:

There is a great deal of sahih (sound) evidence to support this view, including the verse in which Allah, may He be exalted, says (interpretation of the meaning): “And We have certainly given you, [O Muhammad], seven of the often repeated [verses] and the great Quran” [Al-Hijr 15:87]

This verse from Surat al-Hijr is Makkan according to scholarly consensus. The Prophet (blessings and peace of Allah be upon him) explained the “seven often repeated [verses]” as referring to Surat al-Fatihah, which implies that al-Fatihah was revealed during the Makkan period. 

Prayer was enjoined in Makkah , and prayer is not valid without Surat al-Fatihah .

In fact, some of the scholars were of the view that al-Fatihah was the first thing to be revealed, but this is a weak view.
Ibn Taymiyah said: “The Opening of the Book [i.e., Surat al-Fatihah] was undoubtedly revealed during the Makkan period.…
The view of those who say that al-Fatihah was not revealed until the Madinan period is undoubtedly wrong.” (Majmu‘ al-Fatawa, 17/190-191)
A number of well-versed scholars – such as Ibn Taymiyah, Ibn Kathir, Ibn Hajar, al-Baydawi, al-Kawashi, and others – preferred the view that Surat al-Fatihah was revealed during the Makkan period. (See: al-Makki wa’l-Madani by ‘Abd ar-Razzaq Husayn, 1/446-468)
Was Surat al-Fatihah revealed before enjoining prayer?
Al-Qurtubi said in al-Jami‘ li Ahkam al-Quran (1/115): 
“There is no difference of opinion concerning the fact that prayer was enjoined in Makkah , and there is no report to suggest that there was a time when Muslims offered their prayers without “al-hamdu Lillahi Rabbi l-‘alamin”. This is indicated by the fact that the Prophet (blessings and peace of Allah be upon him) said, “There is no prayer except with the Opening of the Book.” This is speaking about the ruling, not when it began. And Allah knows best.”
And Allah knows best.