Day and night on Earth are caused by the planet's rotation around its axis and its position relative to the Sun. The Earth rotates from west to east, so places further east experience daybreak and nightfall sooner. One hemisphere of Earth is in daylight at any given time.
Earth rotates around its axis once every 23 hours and 56 minutes. For simplicity's sake, it's rounded off to 24 hours, and the difference is made up as an extra day every four years.
As a given point on the planet's surface rotates into the path of the Sun's rays, the rays can begin heating and giving light to the planet. The angle starts off very oblique, which causes the Sun to appear low in the sky. At the equator at midday, the Sun is almost directly overhead. This angle increases with distance from the equator. Throughout the day, the planet rotates, causing the location to move gradually out of the path of sunlight. This is nightfall, which is signified by the Sun slipping below the horizon.
Day and night last different lengths throughout the year depending on the tilt of Earth's axis. When the axis tilts toward the Sun, days are longer. When it tilts away, nights are longer.