People used to have dinner in the middle of the work day, hence the the name "middag" (midday = noon).
Nowadays most people have their dinners later in the day, making the name of the meal somewhat misleading. However, we still count noon as the middle of the day, and after noon it's "ettermiddag".
Honestly, the use of "på" and "om" is quite dialect dependent, so you will get different answers depending on whom you ask. In many cases "på" and "om" are interchangeable, but most people will still have a preference for one or the other.
"På" is used when referring to either the next or the most recent [Mon/Tues/Wednes...]day specifically, often as relating to a one-time event on that specific day, though you'll hear "om" used for that as well so it's not a strong preference.
"Om" is often used when pointing to a season or to a recurring event on a specific day/time, but again: "på" is used for that as well.
på/om mandag(en) = on [this/last/the coming] Monday på/om mandager = on Mondays (in general)
As you can see, we use the same singular/plural distinction as you do in English when referring to days, which allows us to be flexible with the prepositions without losing the meaning.
The same is not necessarily the case for other "times" like seasons, weeks, weekends, and times of the day, where the prepositions "i" and "til" are often used to express the "single event" version. You will have to learn the correct prepositions for these words on a word-by-word basis.
When referring to a length of time, you can either use "i" or no preposition (the latter only if the word is modified by a number or determiner of sorts):
"Hunden har sovet [i hele ettermiddag/hele ettermiddagen." "The dog has been sleeping all afternoon."
TL;DR: As far as prepositions go, "om" and "på" (as relating to specific and general points in time) are pretty forgiving even if you get them mixed up. For lengths of time, use "i".
You could say simply "middag", not sure how common "middagstid" is, but I've found that as well. For "it's noon", I have found "det er midt på dagen", but that's "middle of the day", so it depends on what the English says. "Middle of the day" is more of a general term, and noon is exact................For dinner time, I have found "middag" and "middagstid" (seem familiar?) What they mean depends on the context. After all, having "middag" at "middag" may seem fine, unless you're having noon when your watch says dinner ;-D
You could say "middagstid", but I think that is old fashioned, and I think it's quite rarely in use. "It's dinner" = "det er middag" and "It's dinner time" = "det er middagstid". "Det er middag" refers to "the people" having dinner now, but "det er middagstid" might have an implied meaning, for example "maybe we should eat soon". To be honest, I think you should just use "dinner".