There are 24 hours in a day. The day is divided into "day(time)" and "night(-time)". Daytime is from sunrise (this varies, but we can say approximately 6am) to sunset (we can say approximately 6pm). Night-time is from sunset to sunrise.
Every day starts precisely at midnight.
AM (Ante-Meridiem = before noon) starts just after midnight.
PM (Post-Meridiem=after noon) starts just after noon. This means that 12am and 12pm have no meaning.
This diagram shows the cycle of a 24-hour day and the words we use to describe its parts. The day starts at midnight (at the bottom of the diagram).