an extremely long and involved joke with a weak or completely nonexistent punchline
a somewhat intricate, sometimes lengthy story that serves as a setup to a groaner of a bad punch line
a story, usually very long, that is built around a single premise, usually a punch line or a pun
In its original sense, a shaggy-dog story is an extremely long-winded tale featuring extensive narration of typically irrelevant incidents, usually resulting in a pointless or absurd punchline. These stories are also known as yarns, coming from the long tradition of campfire yarns.
Shaggy Dog Story was a charity programme for Children in Need, put together by the BBC in 1999 as a sequel to the previous year's Future Generations video (featuring chilcren's programmes), and the great success of 1997's Perfect Day charity single.