On the fourth day of creation, God created the two great lights - the greater light to rule the day and the lesser light to rule the night - as well as the stars. This is recorded in Genesis 1:14-19. The sun and the moon were created by God to be a source of light and to divide the day from the night. The stars were also created to give light on the earth and to be signs for seasons, days, and years.