The bottom line on doing research: do not guess.
Write what you know. The old adage rings true because readers will catch you in mistakes. If you are writing about a town or city, know the lay of the land. If you are writing about the countryside, don’t put a rocky bluff in the middle of flat land.
Research can take anywhere from two months to years. The average research time for historical fiction is 18 months to two years. Know what tools people use to do jobs. Know daily routines. Is it a foreign country? Know the weather. You may have to sprinkle dialogue with unfamiliar slang. You may have to research your main character’s work, special jargon, and work place environment.
Interview those with experience. An interview can actually save you time. Rather than trying to weed out spurious sources from the internet you can receive clear information. You will be surprised to find that most people are willing to give you interviews and even tours of facilities if you tell them you are writing a story whether novel or screenplay. Interview subjects can also direct you to correct sources to further your information gathering.
The internet works as a great tool for finding basic background material. Be cautious about the sources. Along with detailed information you will find slanted and spurious information. Follow leads like links at the bottom of a Wikipedia page.
While doing your research you will gather details for setting, character development, and even story plot development.
The one false path for writers is to go so far into research that the story does not get written. How do you know when to stop? A better question is: when do you have enough material to really get the details into your story to make it lively? Your story is the main goal. As you continue on with the steps of characterization, setting, plot, etc. you may need to pick up more details. So you may be doing targeted research as you go through the process. This is OK. Don’t let doing research keep you from the story creation process.
Just don’t guess, always check it out.