On the fourth day God created the Sun and the Moon and by inference the rest of the solar system. He had already created Earth on the first day. Then the biblical text (Genesis 1: 16) reports “He made the stars also”.
On a moonless night the heaven displays a myriad of stars visible to the naked eye but billions upon billions more may be seen with the aid of modern large telescopes. It is estimated that the visible Universe contains a hundred billion galaxies each containing on average a hundred billion stars. That is 1022 stars which may be written out this way as 10,000,000,000,000,000,000,000 stars. And the Creator knows them all by name.
He tells the number of the stars; he calls them all by their names. Psalms 147:4