When Was Prayer Made Obligatory?
Question

Is it true that prayer was made obligatory before the night of the Isra’? Did the Messenger pray in the manner that we pray now, with the same number of Rak`ahs? When was prayer made obligatory at these times and in the manner that we pray now?
Praise be to Allah.When was prayer made obligatory? 
Al-Bukhari (349) and Muslim (162) narrated from Anas ibn Malik (may Allah be pleased with him) the famous Hadith of the Isra’ (Prophet’s Night Journey) in which it is reported that the Messenger of Allah (blessings and peace of Allah be upon him) said:
“Then Allah revealed what He revealed to me, and enjoined fifty prayers on me every day and night. I came back down to Musa (blessings and peace of Allah be upon him) and he said: What did your Lord enjoin upon your ummah? I said: Fifty prayers. He said: Go back to your Lord and ask Him to reduce it... I kept going back and forth between my Lord, may He be blessed and exalted, and Musa (peace be upon him), until He said: `O Muhammad, they are five prayers each day and night, for every prayer there will be a tenfold (reward), and that is fifty prayers.” 
The scholars unanimously agreed that the five daily prayers were not made obligatory until this night. (See also Fath Al-Bari by Ibn Rajab, 2/104) 
Al-Hafiz Ibn Kathir (may Allah have mercy on him) said: 
“On the night of the Isra’ , one and a half years before the Hijrah, Allah enjoined upon His Messenger (blessings and peace of Allah be upon him) the five daily prayers, and explained that there were conditions and essential parts and other matters having to do with them, bit by bit.” (Tafsir Ibn Kathir, 7/164)
Then Jibril (peace be upon him) came down and taught the Prophet (blessings and peace of Allah be upon him) the times of the prayers : 
Al-Bukhari (522) and Muslim (611) narrated from Ibn Shihab that `Umar ibn `Abd Al-`Aziz delayed the prayer one day. `Urwah ibn Az-Zubayr entered upon him and told him that Al-Mughirah ibn Shu`bah delayed the prayer one day when he was in Kufah, and Abu Mas`ud Al-Ansari entered upon him and said: What is this, O Mughirah? Do you not know that Jibril came down and prayed, and the Messenger of Allah (blessings and peace of Allah be upon him) prayed, then he prayed and the Messenger of Allah (blessings and peace of Allah be upon him) prayed, then he prayed and the Messenger of Allah (blessings and peace of Allah be upon him) prayed, then he prayed and the Messenger of Allah (blessings and peace of Allah be upon him) prayed, then he prayed and the Messenger of Allah (blessings and peace of Allah be upon him) prayed. Then he said: This is what has been enjoined upon me. `Umar said to `Urwah: Think what you are narrating, O `Urwah! Is Jibril the one who taught the Messenger of Allah (blessings and peace of Allah be upon him) the times of the prayers? `Urwah said: That is what Bashir ibn Abi Mas`ud used to narrate from his father. 
An-Nasa’i (526) narrated that Jabir ibn `Abdullah (may Allah be pleased with him) said: Jibril (peace be upon him) came to the Prophet (blessings and peace of Allah be upon him) when the sun had passed its zenith and said: Get up, O Muhammad. That was when the sun had passed the meridian. Then he waited until the (length of) a man’s shadow was equal to his height, then he came to him for `Asr and said: Get up, O Muhammad, and pray `Asr. Then he waited until the sun set, then he came to him and said: Get up and pray Maghrib. So he got up and prayed it when the sun had set fully. Then he waited until the twilight had disappeared, then he came and said: Get up and pray `Isha’, so he got up and prayed it… In this Hadith it says: He (i.e., Jibril) said: The period between two of these two times is the time to pray. (Classed as authentic by Al-Albani in Sahih An-Nasa’i) 
`Abd Ar-Razzaq narrated in his Musannaf (1773) and Ibn Ishaq narrated in his Sirah – as it says in Fath Al-Bari (2/286) – that this happened on the morning after the night in which prayer was made obligatory. 
Al-Qurtubi (may Allah have mercy on him) said: 
“(The scholars) did not differ concerning the fact that Jibril (peace be upon him) came down on the morning following the night of the Isra’, when the sun passed its zenith, and taught the Prophet (blessings and peace of Allah be upon him) the prayer and its timings.” 
Shaykh Al-Islam Ibn Taymiyah (may Allah have mercy on him) said: 
“Jibril’s explanation of the timings of the prayer came on the morning following the night of the Isra’.” (Sharh Al-`Umdah, 4/148) 
When the five daily prayers were first made obligatory, each prayer was two rak`ahs, then after the Hijrah, that was confirmed in the case of travel, and two rak`ahs were added for those who are not travelling, except Maghrib, which remained as it was. 
Al-Bukhari (3935) and Muslim (685) narrated that `Aishah (may Allah be pleased with her) said: Prayer was enjoined with two Rak`ahs, then when the Prophet (blessings and peace of Allah be upon him) migrated, it was enjoined with four Rak`ahs, but prayer whilst travelling remained as it had originally been. 
How did the Muslims pray before prayer was made obligatory?
The Prophet (blessings and peace of Allah be upon him) and his Companions used to pray before the five daily prayers were made obligatory. 
It says in Al-Mawsu`ah Al-Fiqhiyyah (27/52-53): 
“Prayer was originally enjoined in Makkah at the beginning of Islam, because there are Makkan verses that were revealed at the beginning of the Prophet’s mission that encourage praying. As for the five daily prayers in the form that is well-known, they were made obligatory on the night of the Isra’ and Mi`raj .” 
Some of the scholars are of the view that prayer was made obligatory at the beginning, two Rak`ahs in the morning and two Rak`ahs in the afternoon. 
Al-Hafiz (may Allah have mercy on him) said in Al-Fath: 
“A number of scholars are of the view that before the Isra’ there was no obligatory prescribed prayer, but prayers were offered at night, without any number of Rak`ahs being specified. Al-Harbi was of the view that prayer was made obligatory, two rak`ahs in the morning and two rak`ahs in the afternoon. Ash-Shafi`i narrated from some of the scholars that prayer at night was obligatory, then it was abrogated by the verse (interpretation of the meaning): {So, recite you of the Quran as much as may be easy for you} [Al-Muzammil 73:20]. So it became obligatory to pray for part of the night. Then that was abrogated by the five daily prayers.” 
He also said: 
“Before the Isra’, the Prophet (blessings and peace of Allah be upon him) definitely used to pray, as did his Companions, but there is a scholarly difference of opinion as to whether any kind of prayer was made obligatory before the five daily prayers or not. It was said that what was obligatory at first was prayer before sunrise and prayer before sunset. The evidence for that is the verse in which Allah, may He be exalted, says (interpretation of the meaning): {and glorify the praises of your Lord before the rising of the sun, and before its setting} [Ta-Ha 20:130], and similar verses.” (See also Tafsir Ibn `Atiyyah (1/204); At-Tahrir wat Tanwir by Ibn `Ashur (24/75) 
And Allah knows best.