Why do We have Leap Year?

The earth revolves around the sun in 365 days, 5 hrs and 48 minutes, so every four years we add and extra day to the calender i.e the 29th of February. This is done to sync time and other astronomical events.