Someone once said that "A novel is a work of a certain length, with flaws." I wish I could remember what writer that was, but I love the quote. The question is, naturally, just what is that certain length? We only dare answer with the qualification, "in today's market"! The answwer to the question changes from time to time.
In today's market, young adult novels are supposed to be around 60,000 words. An adult novel comes in, on average, at about 100,000. Mine tend to be slightly longer, and if I worry about that, my agent always says that the book should be the right length for the story, which is advice I can live with. It's tough to sell very long manuscripts these days, but there are occasions when it's possible.
There are other lengths for other forms: the short short story, the short story, the novelette, the novella. The prescribed lengths for these differ according to different sources, but they run from 1,000 words to 49,999, above which the story is considered a novel. I hope that when I have an idea, the length of the story is an organic decision, but sometimes we're asked to do something specific, as for an anthology or a specific magazine. That can be challenging!
The science fiction writer Kay Kenyon has written an entertaining post about why we choose the lengths we do: http://kenyonsf.livejournal.com/45775.html?view=153295#t153295 I'll leave it to her to define the problem.