In regards to timekeeping, "AM" is an abbreviation of "ante meridiem," and "PM" is short for "post meridiem," according to Dictionary.com. Both of these terms are derived from the Latin phrase "mer diem," which means "midday." These terms are often confused with "antemeridian" and "postmeridian."
Standard timekeeping conventions in the U.S. regard AM as the period beginning at midnight, according to Wikipedia. PM covers the period from noon to 11:59. While countries other than the United States sometimes follow local conventions, this is the style adopted by many international bodies and is consistent with the Associated Press style guide. The 12-hour clock can be traced back to Ancient Egypt.