Generally, if you write for publication in a peer reviewed journal, you must make a serious effort to review and discuss all publications relevant to your research. You are building on previous research and not attempting to invent the wheel a second time. So to make your research relevant, it must consider what has been done before. How detailed your review will be, depends on what you research, what has previously been found, and so on. There is no general rule except that journal articels are limited in length (which depends on the journal you are submitting to).
If you don't know how to write a literature review, Google Scholar will help you find peer reviewed scientific publications relevant to your research. Do not use "popular science" articles, since these are usually abbreviated and simplified. Use the original research articles (that should be mentioned in the pop publications). These also contain literature reviews of their own that you can use as blueprints.
Read these two articles by Daryl J. Bem about writing the empirical journal article and writing a review article. Also visit your or the next college or university library. They will have lots of books teaching their students scientific writing. If you study what you research at a college, you should have some kind of course that teaches you how to write in your field. See that teacher and ask or visit that course.
Finally, read the style manuals relevant to your field (APA, MLA, Chicago, etc.). Most of these contain information way beyond simple formatting but also cover planning your research and preparing the results for publication as well as general writing advice. They are very valuable for your research and should be one of your first and constant references.