Grammar is the set of rules for how words change form and combine into sentences. In She walks every day, the -s on walks shows grammar at work.
Word order counts too: The dog bit the man means something different from The man bit the dog, with the same words.
Another use of the word
The word grammar can also mean a book, not just the rules themselves. In this countable use, a grammar is a reference book that lists and explains the rules of a language. You might see this sense more often in British English: I bought a German grammar means you bought a German grammar book.
This second meaning is easy to spot because it usually comes with a or the before it, and the context makes clear that a physical book is meant. So if someone says my grammar is on the shelf, they mean the book, not their knowledge of the rules.