Has an origin from a main character of short story with the same name written and published by Washington Irving in 1819. The term is used to describe persons who fall asleep or are absent for sometime, and do not realize what the hell has happened around them when they wake up or return.
Jane: Oh, there you are, Rick. Good luck on the test tomorrow!
Rick: What? There's a test tomorrow?
Jane: Of course! Our teacher told us. Don't you remember?
Rick: No, not really. I was...
Jane: Felling asleep in the class again, right? Seriously, what's wrong with you? Are you Rip Van Winkle?