There's no literal "The Book", but rather a metaphorical "the book you got it from". Joke books are indeed a thing that exists. Here's one I used to own as a kid.
Jokes generally have prestige based on how original they are. If a person has heard a joke several times before, they aren't going to find it nearly as funny.
If you made it up yourself, that's clearly original. Someone who isn't that clever would be forced to get their jokes from a jokebook like perhaps the one I linked above.
So basically this is a way of denigrating the humor of someone who just told a joke. You are implying they are so unfunny that, not only did they have to get their humor "canned" from a book, but they don't even know enough to avoid jokes their audience is likely to have heard before.