1510s, Scottish, a natural expression of amazement. "This old interjection had a new popularity in the early 1900s and again during the 1960s and later" [DAS].
"overwhelm with delight or amazement," 1924, American English slang, from wow (interj.). Related: Wowed; wowing. Used as a noun meaning "unqualified success" since 1920.