One night as the Prophet (PBUH) was sleeping, Jibraeel awoke him. There was a white animal for him to ride. He (PBUH) was then transported from Makkah to the mosque Al-Aqsa, where
He (PBUH) acted as imam of Prophet Ibrahim (AS), Musa (AS), and Isa (AS) in prayer. Then Jibraeel gave him two jugs, containing wine and milk. He chose the milk and refused the wine. At this, the Jibraeel said, Wine is forbidden. The Prophet (PBUH) passed through the Heaven’s gates and saw countless angels. Prophet (PBUH) saw a view of Hell, and then through the seven Heavens, one by one along the way, he again saw Isa (AS), Musa (AS), Ibrahim (AS), Yahya (AS), Yusuf (AS), Idris (AS), and Haroon(AS). At last, He reached the Lote Tree of the Uttermost, the Sidratul Muntaha where the Prophet (PBUH) received the revelation.
“The Messenger believeth in that which hath been revealed unto him from his Lord and (so do) the believers. Each one believes in Allah and His Angels and His Books and His Messengers – We make no distinction between any of His messengers, and they say: We hear, and we obey.” (Quran: Surah 2, Verse 285)
Then He experienced the Light of the Divine Presence of Allah, and got instructions that Muslims should pray fifty times a day. Musa (AS) advised the Prophet Muhammad (PBUH) on the way back to earth to decline the prayers as people are too weak to perform until he got approved the prayers to five times a day from Allah Almighty.