A preposition is a small word that stands in front of a noun and joins it to the rest of the sentence. In, on and at are three of the commonest, and before a time word they are the three that learners most often mix up.
The rule you are usually given is about length: in for long times, on for days, at for points. Look at what it does with Christmas, which lasts days and takes at, and the afternoon, which lasts hours and takes in. Length is not what is deciding.
The kind of time word
Sort the time word instead. The lab does, into eight kinds. A day takes on. A month, a year, a season or a morning takes in. A clock time, night, noon, midnight or a festival takes at. That is the whole rule, and you can say it in the time it takes to read it.
Run it on 109 printed lines and it is right on 103, which is 94.5%. The novel gives 77 right of 79. The play gives 9 right of 13, and the modern documents 17 of 17. Six of the eight kinds are right on every line: day, month, year, season, festival and clock time. The two that are not are the ones worth reading.
A day beats the part of the day
Morning, afternoon and evening take in, and the table has 22 lines that show it: in the evening, early in the morning. But the table also has seven lines where one of them takes on: on Saturday morning, on Wednesday morning, on the following morning, on the third morning. In each, a day is named or picked out, and the day decides. The rule has a step for this and gets all seven.
What is left over
Six lines are wrong, and they belong to three kinds. Three put on before night with a day name: on Sunday night, on Thursday night, on Wednesday night. This is the same step again. If a named day beats a morning, it beats a night, and that fixes three lines with no cost, because at is still right on the other seven lines of this kind, six of them at night and one at midnight.
Two lines pick the evening or the morning out by words that come after it: on the evening before my going, on the morning of the day. The lab reads only what comes before the time word, so it cannot see these. A person reads the whole phrase, and the whole phrase names one day. The sixth, at evening parties, is not a time phrase at all.
Time words with no small word
Below the table the lab lists time words that have nothing before them: the next morning 17 times in the novel, this morning 13, last night 9. They are not scored, because there is no small word to be right or wrong. If you add one, you have made the error.
Two limits. The lab counts spellings and not meanings, so it cannot tell you the right word for a phrase that is not on its list. And 92 of the 109 lines come from texts written in 1813 and 1895. The modern lines are 17 of the 109, and 16 of those are a year. They agree with the rule, but they test only a corner of it.