You may remember a post I did awhile back on the importance of research (or not, in which case click the link to read it). To sum up, I said the main reason research was important for a novelist is because it helps fill in the gaps in your personal knowledge when you're writing your story. And believe me, there will be gaps. I'm not saying authors aren't brilliantly smart people, but no one knows everything about everything.
How though do you decide what you need to research? And when do you take care of this?
The second question is actually the easiest one to answer. When you research depends on the type of novelist you are: a panster or a plotter. Many plotters I know do all their research before they write a single word. Harry Harrison, author of Tunnel Through the Deeps, once said he spent 5 years doing part-time research before he wrote a single word of that story. Now, that might seem extreme to you but Harrison crafted a vibrant alternate universe extrapolating out all sorts of different aspects of the world of his story. By contrast, many pantsers will either make something up to fill the void until they research it, or type notes to themselves in the text that amount to ((Research 17th C. women's clothing)) or something similar.
What you research is a bit more detailed of an answer. Only a bit more though, because I can similarly sum up my point in one sentence -- research only those items necessary to your story. If your tale is set in France during the 1600s, then you might need to research the clothing, the language, and some of the society (in among a bunch of other things as well). This is also assuming you're not a PhD who's spent 20 years teaching the history of 17th Century France. If you do happen to be a PhD who's spent 20 years studying the topic that will make up the lion's share of background research on your novel, then congratulations! I can't help you.
If, however, you're like me and don't have a degree in Mechanical Engineering when you're writing a character who happens to have detailed knowledge of steam engines and the inner workings of mechanical apparatuses, well then you've put yourself in a bit of a pickle. But only a little bit, because I can almost guarantee your reader isn't going to want a detailed treatise on the inner workings of every mechanical marvel that exists in your novel. So while your character might know a 3/4-inch pickney flange from a 35mm socket head screwdriver, you don't need to write that little piece of information into your story unless it's integral to the plot.
That little emphasized phrase right there is what's important. If the piece of information is integral to the plot, then research the heck out of it. If, however, is a detail that you can cut and no one notices? Well then don't bother. Assume your story is set in the American Southwest during the latter decades of the 1800s. Now, you've gone into detail about setting, clothing, style of weapon being worn, etc ... all details that you need.
However, you happen to neglect mentioning any of the music that the people of your fictional world played in taverns, at parties, and so on -- and the reason you neglect this is because it's not germane to your story. This means that there's no reason for you to research an entire aspect of society in the American Southwest because it's not something you're going to need to know for your story.
That's my main point with your decision about what to research. If you knowing it gives your story a deeper subtext, or it's integral to the motion of your plot, or including the detail deepens some aspect of your story then by all means research to your heart's content. If, however, it's something that doesn't really do anything for your story then feel free to ignore it.
That's just my opinion though. What do you think?
NOTE: My Ten-Word Novel Contest ends tonight at midnight U.S. Eastern Time. Get those entries in, folks!