An interjection is one or more words uttered or written as an exclamation or an expression of emotion. I already provided a lifetime supply of them in a previous post, but here are some additional notes about one of the most ubiquitous of them all: oh.
Whether this all-purpose exclamation is followed by a comma or not depends on its purpose. “Oh, my” and the like are expressions of any one of a variety of emotions or comprehensions, including pain or repulsion, or surprise or wonder. Oh is also a placeholder that signals dismissiveness (“Oh, don’t mind me”) or indicates an approximation (“He was, oh, about this tall”). Say is employed in a similar usage (“What if I were to offer you, say, twice as much?”).
Its poetic equivalent, known as the vocative O — a stylized form of direct address meant to evoke a classical lyricism, is rarely followed by a comma: “O Lord!” is the utterance of someone asking for attention from a deity; “Oh, Lord” might be a more mundane request for consideration from a nobleman, though it often serves simply as an oath or a variant of “Oh, my.”
Some usage guides omit the comma when oh is used for the latter constructions, but the punctuation is a pertinent marker for a slight pause in this case and for similar utterances like “Oh, right” or “Oh, crap.” Likewise, a comma separates oh from a lengthier phrase: “Oh, where did I put it?”