the narrative of the work should drive the number of pieces shown. Obviously if you made a book of 50+ images that's A) a lot of prints to make, and B ) hard to fit in a modest sized gallery. You should also consider your audience. Can you effectively tell your narrative in 15-20 images? Does the body of work have filler images that don't need to be displayed (nothing wrong with filler images in books).
I had a show last year for a book I made with another photographer. We each shot 50 images for a split book and decided to choose our best 25 to display for the run of our show. As long as your narrative can be effectively presented, you don't need to have a lot of prints. I would say that size is more important than quantity, but use your own discretion.