This snowclone originated with the 1993 California Milk Board ad in which a collector of the very paraphernalia of a famous duel attempts to answer the contest question “who shot Alexander Hamilton?” with a mouthful of peanut butter sandwich. He cannot make himself understood, and finds he has run out of the milk which would help him wash that mouthful down, and so loses the contest. The ad ends with the words “got milk?”
As I recall, the ad was very popular, and was part of a set of similarly-themed ads in which the protagonist finds himself alone with a mouthful of something sticky and no milk. Its ubiquity is what I think helped snowcloneize the phrase, since “got X?” isn’t a particularly idiomatic construction.
This snowclone is used in situations where someone is trying to sell X, or it is presumed that X is something everyone needs or wants.
Instances of this snowclone are tricky to track down with snowclone.pl or Google, since searches on “got X?” or “got *?” are a little too permissive. Variations I have seen on bumper stickers and in my daily life include:
X does not need to be a one-syllable word, as the last example illustrates. It does need to be a noun, but the noun type is not particularly limited, as far as I can tell, though of course it does need to be something that can be referred to without an article (a(n)/the). (I.e., mass nouns, except I’m not sure that aloha and subluxation are considered mass nouns.)
More modern “got milk?” ads can be seen here.