The Earth rotates on its axis and moves counter-clockwise, this means that the Earth rotates from west to east. It takes approximately 24 hours to rotate fully. It is because of this rotation that we have day and night.
The Sun rises first in the countries located in the east.
The Earth is divided into 24 time zones resulting of dividing 360º of the Earth's sphere into 24 hours that it takes for the Earth to make a complete rotation on its axis. Consequently, countries in the same time zone share the same time.
Here you have an easy explanation about how Time Zones work.