What is grammar? Grammar is the study of the set rules that tell us how to speak and write in any language correctly. Thanks to learning grammar, we know how to build words and phrases. In other words, it is not enough to know many Russian words, you also need to know how to use them in the right order and with the right endings, so you can create sentences in Russian.
When should you start learning grammar? When it comes learning a foreign language, the more you learn the better. That's quite logical. But in order to set priorities, we have to know the best moment for each step in the learning process. In general, we can say that right at the beginning you shouldn't worry about grammar too much. Once you know some vocabulary, you can start having a look at cases, verb tenses or the word order in a sentence. In other words, before knowing grammar you should learn vocabulary.
Russian language is not an exception: the case system is important, but knowing it perfectly won't help you much if your vocabulary is limited. If you have just started learning Russian, you can visit other sections in this website (for example, our Russian courses for beginners) before focusing on grammar.