One day Hisham Ibn Hakam asked Imam Musa Kadhim (a.s): Why are there seven Takbirs (Allaho Akbar) in the beginning of the prayers? And why is “Glory be to Allah, the Mighty and Praise be to Him” recited in the bowing (ruku) and “Glory be to Allah, the High and praise be to Him”, recited in the prostration (Sajdah)?
The Imam (a.s) said, “When the Holy Prophet (S) went to the heavens on the night of Ascension (Meraj), the curtains began to move aside from before his eyes. When the first curtain moved, he said Takbir. When the second one moved he recited the second Takbir. In the same way, he recited seven Takbirs on the opening of seven curtains. After this when he saw the Divine Glory, he began to tremble and he bowed down and said, ‘Glory be to Allah, the Great and Praise be to Him’, when he arose from the bowing (ruku) he beheld the Divine Glory more enhanced, he at once fell down in prostration and said, ‘Glory be to Allah, the High and Praise be to Him’ seven times in the Sajdah (Prostration). Then the trembling of his heart abated.”
Reference :Akhlaq al-A’imma, Morals & Manners of the Holy Imams