The full form of “AM” is “ante meridiem,” which is Latin for “before midday.” It refers to the time from midnight (12:00 AM) to just before noon (11:59 AM).
The full form of “PM” is “post meridiem,” which is Latin for “after midday.” It refers to the time from noon (12:00 PM) to just before midnight (11:59 PM).