The time of day is measured in 12-hour or 24-hour time.
12-hour time is where the day is broken into two parts:
am = ante meridiem - from 12am (midnight) to 12pm (midday). This is often called the morning.
pm = post meridiem - from 12pm to 12am. This is often called the afternoon and evening.
Midnight is 12am or 0000 hours, when a new day starts.
Midday or noon is 12pm or 1200 hours, the middle of the day. This is around the time when people have their lunch.
24-hour time is when the day is one long day from 0000 hours (midnight) through to 2400 hours (midnight the following day).
We do not write am or pm with 24-hour time.
eg 1330 = 1:30pm (in the afternoon)
eg 0405 = 4:05am (in the morning)
eg 2040 = 8:40pm (in the evening)
Technically, we do not write 2400 hours, as this is the same as 0000 hours, the next day.
So we go from 2359 (11:59pm) to 0000 (12am).