Really, when someone asks that, I'm not sure they mean what they actually say. I mean, anyone can get an idea for a book from wandering around at the mall and
stalking the lady who's having a screaming fight with her boyfriend on her cellphone eavesdropping.
So, I think what this question is all about is, how do you transform that hey, that's a neat story idea into, hey, that's a short or a novella or a novel. How do you know it's worthy, and why did it beat out the other fifty ideas you had today to become a real boy? Or girl. Or mutant yeti ski patrol shifter guy. <.< >.>
For me, what it takes it two-fold. I need a character attached immediately. At least one. Not always two, since I often co-write with my partner BA, so I can pitch her a single and come back with a double or a triple. I need a character, though, who wants the story. Who won't shut up, sure, but who also wants it now. Who is willing to slam in and push the wolves and kitties and cowboys and firemen around like bowling pins to get his or her place.
After that, I need the story to be enough. If I can tell it all to myself in a minute flat, it won't ever make it on the page. I have to know there will be more, that the inspiration I saw in that moment in the mall will only be the tip of the iceberg. Sometimes that bites me on the butt, as I end up with too much story for the deadline I'm fighting. Then I get the reviews. You know the ones. I loved this, but...
Still, I think that's what it means to get an idea. It's not just the a ha moment. It's the happy little brain thunderstorm that happens afterward, and I think that's something you have to be able to experience in order to be a writer. If you stop at, "hey, that would be a neat story," then it's never going to become anything but a neat idea. Which is totally okay, too. That's just my take on an age-old question.
Feel free to tell me yours!