As the Earth moves around the Sun. It also spins round on its axis. This means that different parts of the Earth are lit up at different times. When our art of the Earth is lit up it is daytime for us. As we move round, away from the Sun, it becomes dark and we can see the stars; this is night-time.
The sun appears to move across the sky, but in fact the Earth is moving around the Sun.