Allah, may He be glorified and exalted, created the heavens and the earth in six days, as He, may He be exalted, says (interpretation of the meaning):
“Indeed your Lord is Allah, Who created the heavens and the earth in Six Days, and then He Istawa (rose over) the Throne (in a manner that suits His Majesty)”
The creation of the earth preceded the creation of the heavens, then the spreading out of the earth, when He “brought forth therefrom its water and its pasture; and the mountains He has fixed firmly” [an-Naazi‘aat 79:31-32], came after the creation of the heavens, as Allah, may He be exalted, says (interpretation of the meaning):
“Say (O Muhammad (blessings and peace of Allah be upon him)): ‘Do you verily disbelieve in Him Who created the earth in two Days and you set up rivals (in worship) with Him? That is the Lord of the Alameen (mankind, jinns and all that exists).
He placed therein (i.e. the earth) firm mountains from above it, and He blessed it, and measured therein its sustenance (for its dwellers) in four Days equal (i.e. all these four days were equal in the length of time), for all those who ask (about its creation).
Then He Istawa (rose over) towards the heaven when it was smoke, and said to it and to the earth: ‘Come both of you willingly or unwillingly.’ They both said: ‘We come, willingly.’
Then He completed and finished from their creation (as) seven heavens in two Days and He made in each heaven its affair. And We adorned the nearest (lowest) heaven with lamps (stars) to be an adornment as well as to guard (from the devils by using them as missiles against the devils). Such is the Decree of Him the All-Mighty, the All-Knower.”
See: Tafseer as-Sa‘di (p. 745)
And Allah, may He be exalted, says (interpretation of the meaning):
“Are you more difficult to create, or is the heaven that He constructed?
He raised its height, and He has equally ordered it,
Its night He covers with darkness, and its forenoon He brings out (with light).
And after that He spread the earth”
We do not know of any sound evidence from the Qur’an or Sunnah that tells us when Allah created the stars that are in the heavens. With regard to His saying, “And We adorned the nearest (lowest) heaven with lamps (stars) to be an adornment as well as to guard” after saying “Then He completed and finished from their creation (as) seven heavens in two Days” [Fussilat 41:12], this does not indicate that the stars were the last thing that Allah created. Rather it is simply stating the wisdom behind the creation of the stars, which is included in what Allah says about the heaven and its creation, and the signs that He placed in it.
Al-‘Allaamah Ibn ‘Ashoor (may Allah have mercy on him) said:
The verses were speaking in the third person and then moved to the first person: “And We adorned the nearest (lowest) heaven with lamps (stars)” so as to maintain the listener’s interest after having used the third person (in the preceding passage) starting from the words “…Him Who created the earth in two Days” [Fussilat 41:9]. It also highlights the special care given to the creation of the stars that benefit people in both their religious and worldly affairs, by singling them out for special mention from among the general meaning of the verse “and He made in each heaven its affair” [Fussilat 41:12]. The lowest heaven is just one of the heavens, and the stars are just part of its system.
The word masaabeeh (translated here as lamps) is the plural of misbaah, which refers to that which is lit with fire in oil to produce light. This word is derived from sabaah (morning), because people use the lamp as a replacement for the light of morning. What is meant by lamps in this verse is the stars, which are referred to in this metaphorical manner because of what they show of light.
What is meant by the word translated here as “as well as to guard” is to protect the heaven from the devils who try to eavesdrop.
“Such is the Decree of Him the All-Mighty, the All-Knower” – this refers to what is mentioned in a previous verse: “He placed therein (i.e. the earth) firm mountains from above it” [Fussilat 41:10] up to the words (in v. 12) “And We adorned the nearest (lowest) heaven with lamps (stars) to be an adornment as well as to guard”.
End quote from at-Tahreer wa’t-Tanweer (24/25 1)
There is nothing in the text to tell us of the time of the creation of the stars in particular, and there is no benefit in knowing that in terms of one’s religion, and there is nothing bad about not knowing it, as it does not detract from one’s faith. Rather what will benefit a person is to reflect upon their creation and think about the wisdom of the Creator, may He be glorified and exalted, and to find in that evidence of His greatness and oneness, and submit to obeying Him.
Thirdly these stars in the heaven – including the sun – are called in Arabic masaabeeh (lamps), nujoom (stars), kawaakib (heavenly bodies) and suruj (lamps). The difference between these words is the matter of terminology introduced by scientists, and does not necessarily stem from the Arabic usage at the time of the Prophet (blessings and peace of Allah be upon him).
If anyone asks about calling all of these heavenly bodies by all of these names, if he means in terms of the Arabic language and the way it was spoken, then the matter is broad in scope and all of these terms are acceptable.
If he is asking about terminology as known to the scientific community, then that is not the case, and he should refer to the terminology of each branch of science and ask the people who know that branch of science.
Ibn Saydah [a grammarian] and others said: A kawkab (heavenly body) is a najm (star).
Lisaan al-‘Arab (1/720).
Ibn al-Jawzi said:
The masaabeeh (lamps) are the nujoom (stars) and the suruj (lamps). A kawkab may be called a misbaah. End quote.
Zaad al-Maseer (4/47)
The Arabs use the verb najama to refer to anything when it appears.
The linguists said: The word nujoom refers to all kawaakib (heavenly bodies).
Lisaan al-‘Arab (12/568).
The root meaning of the word burooj (big stars) is appearing.
Al-Qurtubi (may Allah have mercy on him) said:
The root meaning of burooj is appearing. From the same root comes the word tabarruj which refers to a woman who shows her adornments. Al-Hasan and Qataadah said: The burooj are the nujoom (stars). They are so called because they appear and rise up. End quote.
Al-Jaami‘ li Ahkaam al-Qur’an (10/9)
This word (burooj) is used in the Qur’an to refer to the stars in the sky, and also the manaazil (mansions) of the sun and moon.
An example of the former is the verse in which Allah, may He be exalted, says (interpretation of the meaning): “And indeed, We have put the big stars [burooj] in the heaven and We beautified it for the beholders” [al-Hijr 15:16].
As-Sa‘di said: That is, stars like big towers and mountains, by means of which people navigate in the darkness on land and sea. End quote.
Tafseer as-Sa‘di (p. 430)
An example of the latter is the verse in which He, may He be exalted, says (interpretation of the meaning): “By the heaven, holding the big stars” [al-Burooj 85:1].
At-Tabari (may Allah have mercy on him) said:
The most correct view concerning that is that what is meant is the heaven containing the mansions [manaazil] of the sun and moon. That is because the word burooj is the plural of burj, which means tower, and the mansions are high above the ground. This is seen in the verse in which Allah says (interpretation of the meaning): “…even if you are in fortresses [burooj] built up strong and high… ” [an-Nisa’ 4:78]. So they are lofty mansions in the heaven, of which there are twelve. The passage of the moon through each mansion takes two or three days, so there are twenty-eight mansions, then it is hidden for two days. The passage of the sun through each mansion takes one month. End quote.
Tafseer at-Tabari (24/332)
And Allah knows best.