The term contact high refers to a euphoric feeling that is acquired secondhand. The phrase originated during the late 1960s, when LSD became a popular drug of choice. Users would describe their hallucinations, and frequently companions who weren't taking acid would see the imaginary objects themselves.
Although today the phrase is most often used to refer to a buzz gotten by merely breathing in the fumes of someone else's marijuana while not inhaling yourself, the term can also be used in the non-narcotic sense of the word "high." The most common example is when someone in a group gets the giggles, and soon everyone else is laughing hysterically, too.
Usually, the phrase is used by people to downplay their own participation in the act of actually getting high. Someone who's been pulled over for suspected driving under the influence may just claim to be suffering from a contact high. It may also be used condescendingly, by suggesting that the contact high is inferior to the real thing.