How many rejections before I just give up on my book?

There is of course the "slot-machine" approach.  Just keep pulling the handle (Old Vegas) or punching the button (New Vegas), because the three cherries just might align.  And you'll never get them to align if you stop the pulling and the punching. With a slight qualification, this metaphor has much to say for it.  One person's meat is another's poison--or in the case of writers submitting to agents or independent presses, more like dozens of persons' poisons might just be one person's meat. 

The qualification is being willing to revise before you sit back down at the slot machine.  Read your book again and see if you've missed on anything--style, plot, characterization,   Is the opening attention grabbing?  Is the conclusion adequately prepared for? 

If you've done that and you still BELIEVE in your book, then keep submitting!  Take rejections as business decisions not as personal assessments of your worth as a writer.

Who am I to give such advice?  Brothers and Sisters, I have had over 1,000 (one thousand) rejections of my various novels by agents since I started submitting queries, partials, and full manuscripts.  Several of the books I have published were all rejected.  I read them again (several times), did revisions, and resubmitted and resubmitted and resubmitted. 

Yes, I emerged from the battlefield bloodied but unbowed--but also with a number of book contracts in my hand!

"I have writer's block." 

   "I'm not inspired to write today."  

      "Thursdays are never good for my muse."

Sound familiar?  Surely, there's nothing better when one sits down to write than seeing and feeling the road cleared and that strong gust of inspiration on a lovely Wednesday afternoon. But I've found that the great eighteenth-century writer Samuel Johnson nailed it when he said, "A man [woman] may write at any time, if he [she] will set him[her]self doggedly to it."  Of course Johnson also supposedly said, "No man but a blockhead ever wrote, except for money."--but I'm sure he was only kidding.  If he wasn't, then count me as one of the blockheads.