In order to understand this question, we need to first ask what word gives the meaning of “O”, as in a call to something.

The answer to this is the preposition يا  also known as حرف النداء. It will come before a word and give the meaning “O”.
For example, يا بلالُ اِذْهَبْ – O Bilal! Go!

One of the tricky things about this preposition is that it affects the ending voweling of the following word in a unique fashion. Although the rules get complicated, I will break it down very simply.

  1. If the word that comes after يا is a proper name, that name will take a single dhamma at the end, as in the example above: يا بلالُ****** (For Nerds) In this situation, although there is a dhamma, it is in the state of نصب, acting as the direct object (مفعول به) to a hidden verb. In other words, يا بلالُ can also be understood a أُنادي بلالاً (I am calling Bilal)
  2. If the word that comes after يا is a compound structure (مضاف و مضاف إليه) then the first word will take a fatha.
    For example: يا أَميرَ المُؤمنين. “O leader of the believers.” Leader of the believers is a compound structure, and the first word, leader, takes a fatha.

Based on these examples, if we wanted to say “O Allah” it would be يا اللهُ

———————————————————————————————————————————————————

We all wish it were this simple, but Arabic is an endless wonder. But don’t worry, I’ll guide you along :)

Sometimes the يا is missing. The reason? A lot. One of the major reasons is for simplicity or possibly for rhyming. This discussion could go on forever so I will leave it at that. The question is, what happens when the يا drops? That is where the discussion of اللَّهُمَّ enters.

If the يا drops in يا اللهُ, a مَّ will attach at the end of الله (linguistically) to make up for the يا so the reader knows it means “O Allah” instead of simply “Allah”. The fatha on the meem has no real significance.

******* (For Nerds) Remember how there was a dhamma on a proper name? Well that still is on اللَّهُمَّ, on the ه letter. Since الله is actually in the state of نصب it will affect other words as well, specifically adjectives. This is why in the verse:
﴾ قُلِ اللَّـهُمَّ مَالِكَ الْمُلْكِ ﴿, the reason why مَالِكَ has a fatha is because it is an adjective to الله which is in the state of نصب, and all adjectives copy states.