Can have three meanings:
1. A simple joke about a boy and his Shaggy Dog, which is made to have no punchline to invoke some kind of laughs
2. A joke that goes on and on just for a bad or boring ending
A movie or a book that is just like (Definition) 2 but for books/movies
1. "I said the shaggy dog story to a couple of fellows, funny to think they actually laughed"
2. "I can't believe I wasted my money just to see a wannabe comedian say a shaggy dog story"
3. "After 757 pages of build-up, the treasure was just a rubber chicken. Talk about a shaggy dog story."