Research is a vital part of the writing process. It can add life to your story, strengthen details and fill in background. We, as authors, have the ability to write about anything but with that comes a certain responsibility to our readers. We have to present a believable world in which the story happens or the reader will lose interest. If they can't believe in the world because things just don't work right or sound right, they can't believe in the story and they can't enjoy it. When it comes to a story, we have to do our homework. A gun has to work like a gun, a car has to run like a car, a character's job needs to make sense, etc. Now, we can often gloss over certain things. The character can simply get in the car and drive off, but we can't do that with everything or the story will feel flimsy. When you can add specific details, just here or there, a bit of knowledge, can really get the reader interested. If I read a story, get enjoyment and learn something? That's awesome!
There is such a thing as putting in too much detail. It's good for you as an author to know how things work in your story but you don't need to try to teach your reader every single fact involved in your story. If your story is about whaling, that doesn't mean you need to inform the reader on every aspect of whales, whaling, whaling ships, paintings of whales, etc. (I'm looking at you Moby Dick).
So you don't need every detail of every system involved in your story but you do need to know the basics. If you don't understand how something works, it's likely that will come across in your story and the reader will be able to tell. Research adds depth and realism.
Now, you might say "my story is set in a whole new world so I can make everything up HAHA I WIN I TRICKED YOU BOOYAH!" or "I'm writing sci-fi/fantasy so I don't need to do research". False. Wrong. Research can still strengthen your story. Knowing how medieval combat was actually carried out can really make your fantasy battles that much more believable. Knowing particular topics in science that relate to your sci-fi story can make it that much more interesting to the reader.
There is another form of research you have to go through when you create your own world. What do I mean by that? Call it....Internal Research. You need to act like a researcher. You need to ask questions about this new world, the history, the politics, the systems in place, the people, etc. Though you are creating the answers, the questions still need to be addressed and 'research' still needs to be done.
There can be such a thing as doing too much research. When you've got twelve tabs open in firefox, each filled with pages upon pages of text and you've been looking for hours, leaving your story stagnant and stuck, it's time to buckle down and just get to writing. Research is important but of course, writing is more important. You can always come back after learning new things and edit in what you've learned through research.
Write first, ask questions and research the answers to those questions, later.