"Oh" is an interjection expressing
any number of emotions, including surprise,
exasperation, desire, and gratitude.
"O" begins an address to a person or to God (thus it performs the same function that the
vocative case performs in certain
languages, for example in Latin; hence
the term "Vocative 'O'").
A cute twist: in Othello's lament, "O Desdemona!", the "O" may be read in whichever sense one wishes, either as an address to his slain wife or as a lament for her.
"O'" with an apostrophe can either serve as a contraction of the word "of" (e.g. "8 o'clock", "cat o' nine tails") or serve to create a patronymic in English renditions of Irish Gaelic (O'Dwyer =
Ó Dubhuir = Son of Dubhuir).
Finally, "O" may stand for the letter itself or for the number "0" (007 is pronounced, "Double O Seven"; in this last capacity, "Oh" is often substituted: "a rendezvous at 0800" may be read,
"a rendezvous at zero eight hundred hours" or, informally, as, "a rendezvous at Oh eight hundred hours").
The choice to add the "h" would seem to be either an attempt to distinguish between the various meanings of the word or a simple fluke in orthography. I can't detect any difference in the pronunciation.