|Definitely a picture we can relate to.|
While you're writing, word count is not important. Yes, do set word count goals for yourself. But don't stress over it. If you're going along, writing your book, and estimate that it'll end up being 55,000 words, that's great. And if you end up writing 70,000, that's great too. If you end up with 45,000, it's still great. Before you stress over what's publishable, finish the book. Write the story as it wants to be told. If your characters want to pull you into an 120,000 beast, go with it. If you find that you're at 50,000 words with nothing more to say, awesome. At this point, it doesn't matter.
There's not a definite word count that your novel should be. YA novels are quite a range of lengths. The general consensus seems to be that standard YA novels are somewhere between 50,000 and 90,000 words (and this is a very generous estimate with a rather wide range). There are exceptions, of course, but that's the general range. YA epic fantasy has a little more wiggle room on top, and can be in the 100,000s or even 110,000s.
If you aren't in this range, you won't automatically get rejected by every agent you query. For many agents, word count itself is not a cause for rejection. If you query a YA book on the upper ends of this spectrum, it might be a red flag for that agent, but it doesn't mean they won't consider you.
The key is that if your book is going to be that long, there needs to be a good reason for it. Many times, novels are overly long because the author uses too much description and is too wordy. Sometimes, though, books are long because they have a complex story to tell. If you want to get your long book published, you need to make sure every word counts. You need to prove to agents and publishers that every word is worth it.
Having a book that's too short is a less common problem. If your book is way below this range, agents are going to start to question your ability to flesh out characters and plots, and your knowledge of the YA genre (as in, is your 40,000 word book actually more MG but you're calling it YA because you haven't done your research?
To give you a frame of reference, here are the word counts of some familiar YA novels. Many of these have rather unusual word counts. I'm just giving you these numbers so you can get a better idea of how big of a book a certain word count translates to.
Eragon by Christopher Paolini: 157,220
Artemis Fowl by Eoin Colfer: 56,684
The Lightning Thief by Rick Riordan: 87,223
Holes by Louis Sachar: 47,079
The Hunger Games by Suzanne Collins: 99,750
Paper Towns by John Green: 81,739
The Lion, the Witch, and the Wardrobe by C. S. Lewis: 36,363
Harry Potter 1: 76,944
(Look at that. Look. At. That. 257,045. That might get you insta-rejection from most agents if you're a debut author. Just goes to show that it pays to be an established author with a ginormous fanbase. Can you imagine typing that many words? And Inheritance is actually a few thousand words longer!)
To sum it up, don't worry about your word count while you're writing. Don't let thoughts of word count interfere with the natural telling of your story. And even after that, you should be aware of the general publishable range, but nothing is ever set in stone. Don't let word count run your story.
Sometime soon I will post a follow-up article on ways to fix up your novel if it's way too long or way too short. Stay tuned!
PS: Maggie Stiefvater, author of such utter wonderfulness as The Scorpio Races, just so happened to post on having long word counts today.