"Taps" concludes many military funerals conducted with honors at Arlington National Cemetery and elsewhere in the United States. The tune is also sounded at many memorial services in Arlington's Memorial Amphitheater and at grave sites throughout the cemetery. It is also regularly played at the American Cemetery in Normandy, France, to commemorate the sacrifice made, at and around that site, by United States servicemen in WWII, during the Allied effort to liberate Europe from the Nazis.
Captain John C. Tidball, West Point Class of 1848, started the custom of playing "Taps" at military funerals. In early July 1862 at Harrison's Landing, a corporal of Tidball's Battery A, 2nd U.S. Artillery, died. He was, Tidball recalled later, "a most excellent man". Tidball wished to bury him with full military honors, but, for military reasons, he was refused permission to fire 7 rifles three times (21-shot salute) over the grave. Tidball later wrote, "The thought suggested itself to me to sound taps instead, which I did. The idea was taken up by others, until in a short time it was adopted by the entire army and is now looked upon as the most appropriate and touching part of a military funeral." As Tidball proudly proclaimed, "Battery A has the honor of having introduced this custom into the service, and it is worthy of historical note."
It became a standard component to U.S. military funerals in 1891.
"Taps" is sounded during each of the military wreath ceremonies conducted at the Tomb of the Unknown Soldier every year, including the ones held on Memorial Day. The ceremonies are viewed by many people, including veterans, school groups, and foreign officials. "Taps" also is sounded nightly in military installations at non-deployed locations to indicate that it is "lights out", and often by Boy Scouts, Girl Scouts and Girl Guides to mark the end of an evening event such as a campfire.
some parts of this comes from Wikipedia