AM and PM are used when telling the time (using the 12-hour clock) to specify whether we mean the morning or the afternoon.
a.m. stands for ante meridiem, meaning “before noon”. So 6 a.m. means 6 o’clock in the morning.
p.m. stands for post meridiem, meaning “after noon”. So, 6 p.m. means 6 o’clock in the afternoon.
Recommended for you: What Time Is It? How to tell time in English