The Quran says the heavens and earth were once joined together and then separated, that the heavens are expanding and that creation took place in six 'days' or periods. The Quran does not give the age of the universe, and Muslims generally accept scientific estimates.
The fuller answer
The word 'yawm' (day) in the Quran can mean a period of any length, and the Quran says a day with God can be like a thousand years. So six days for creation does not fix a number of earth days. Muslim scholars often connect verse 21:30, about the joining and parting of the heavens and earth, and verse 51:47 about the heavens being expanded, with the Big Bang and the expanding universe.
Some Muslims are careful about these comparisons. Science changes, and the Quran is a book of guidance. The point of these verses is to point out God's power, and Muslims treat them as signs to reflect upon, with no need to prove every verse with science.
Have those who disbelieved not considered that the heavens and the earth were a joined entity, and We separated them and made from water every living thing? Then will they not believe?
Indeed, your Lord is Allah, who created the heavens and earth in six days and then established Himself above the Throne. He covers the night with the day, [another night] chasing it rapidly; and [He created] the sun, the moon, and the stars, subjected by His command. Unquestionably, His is the creation and the command; blessed is Allah, Lord of the worlds.
And they urge you to hasten the punishment. But Allah will never fail in His promise. And indeed, a day with your Lord is like a thousand years of those which you count.
This answer follows the mainstream Sunni understanding and is general learning, not a fatwa. Where Muslims differ, the answer says so. Have a question of your own? Write to us.