It's All Science!
Well, astronomy to be precise. Now, we all have studied about the revolution cycle of the Earth around the Sun and that it takes 365 days for one cycle. The exact amount of days though roughly fall to 365.2422, which means an added 6 hours to every cycle. To make matters simpler and to keep our calendars and our clocks in sync, the Gregorian calendar uses 365 days and combines the additional 6 hours every four years to form a leap year.

Blame It On Julius Caesar
Long back in 45 BCE, Julius Caesar had taken the help of his astronomer Sosigenes to alter the calendar that was used by Romans and had 355 days and an additional month with 22 days that occurred every two years. This was fairly inconvenient and Sosigenes instead, decided to create a new calendar that had 365 days and the additional day that happened every four years.

(Image Courtesy: Famous People)
Changes By Pope Gregory
Though the changes by Caesar and his astronomer were not quite enough, and later in 1582, Pope Gregory XIII brought his own changes. According to him since the earth year is not exactly 365.25 days, the years divisible by 100 would not be considered leap year unless they are divisible by 400.

(Image Courtesy: Library of Congress)
February was a Victim of Ego
Due to the ego of Roman Emperor Caesar Augustus, every month except February has 30 or 31 days. Previously when Julius Caesar reigned, the month of February had 30 days while the month that was his namesake- July had 31 days, August had 29 days. Augustus took this as a slight rebuke and when he ruled, the month of August gained two more days while February lost its two days.

(Image Courtesy: History Travels with Nancy)
Interesting Facts
A very interesting fact about the leap year is that according to BBC, there are only estimated 5 million people worldwide born on a leap day. The mystery of this day was added by "The Salem Witch Trials" which began on 29 February 1692.