"Di mattina" means mornings in general, as opposed to a singel or particular morning. I therefore think a closer translation of "Lavoro di mattina" would be "I work mornings".
Prepositions differ from language to language and often you have to learn them by hart. In English we "are" hungry / seven years old / tired etc. In Italian (and some other languages) you "have" all of these things.
So guys, I will not act like an expert in Italian, but I have found that Italian is sort of like old english. I did not understand why "lavoro di mattina" was "I work in the morning" because I've always understood the article "di" to mean of. When I started to read this sentence in old english, "morning of work," and converted it to how we would speak modernly, it finally made sense. I hope this might has cleared up at least a fraction of misunderstanding.
I'm not sure whether Jtd means Old English (i.e., the language of the Beowulf poet) or old English (i.e., English which is old, which could mean anything from Old English to the English of Shakespeare or the King James Bible; or even conceivably obsolete language from just a few decades ago). I'd think the natural way to say it in Old English would be the same as modern English (e.g., "ic wyrce on morgenne" or so), but "I work of a morning" is perfectly acceptable, if somewhat poetic/dialectical, in 21st century English, too.
I think one of the most important things to remember is that Italian is not English! If you translate everything you see, you will be speaking an English/Italian hybrid of a language. Of course, you need to translate vocabulary words in order to understand what people are saying, but at the same time, you need to study the language as it is in itself, not as it is compared to English. This is because you will run into sentences that don't make sense at all. For example: "Al bambino piace giocare a calcio." This would literally mean something along the lines of "To the boy likes to play to soccer." I hope what I have said makes sense, and I would like to see what you guys have to say about it.
What you need to do is study the preposition used in different sentences. In this instance, you use "di." It is an Italian phrase that roughly means "I work during the morning." "Io lavoro di notte." "Io gioco di sera." "Io mangio di matina." However, the rules that apply to time and other categories are different in Italian. Some sentences go along the lines of, "Questa è la mia casa in Inverno." "Questo è un parco in Estate." etc. I hope this helps, but just remember that this is not English. Study Italian as you see it. Best of luck to you. :)
Preposition usage (in, at, on, of,...) is frequently one of the most idiomatic parts of learning a language - sorry. Unfortunately there isn't an easy explanation.
Generally (most commonly): di means of, in means in, a means at, su means on. But there are LOTS of exceptions. One of the exceptions is that Italian uses a with months of the year (eg. a febbraio translates to in February). Another exception is Italians say nel piatto (in the plate) rather than on the plate.
All you can do is learn the most common meaning and then when you encounter exceptions learn them as well.
I'm no native speaker, so I'm not completely sure: My guess is that "di" expresses a habit, so by saying "lavoro di mattina" you basically say that you usually work in the morning. In contrast to that, "al" expresses something that is done once at the said time. So "mangio cioccolato al pomeriggio" means you eat chocolate in the afternoon on that given day, but not on every day.
Apparently they are both used and mean morning. "la mattina" is most common but "il mattino" is used in certain fixed expressions and proverbs. This writer's bottom line is stick with "mattina" unless quoting a fixed expression or a proverb. Here is a link for examples: https://blogs.transparent.com/italian/mattina-o-mattino/
I have seen several comments address why we are using "di" here, but I am still a little cloudy on the subject. I've also come across many, many definitions for "di". It seems to be a preposition that can mean nearly anything. Would it be incorrect to use "sulla" in its place to mean "on"? If so, why?