A useful thing to know early: grammar is not the bottleneck at any JLPT level. Vocabulary is, from N3 upwards.
The full grammar syllabus for any level fits in a single book you could work through in a few months. The vocabulary for the same level takes a year. Plan accordingly — and then attend to grammar properly anyway, because what it asks of you changes as you climb.
N5: the frame
です/ます. The core particles — は, が, を, に, で, と, から, まで. Present and past, positive and negative. い- and な-adjectives. Basic て-form. Simple questions.
This is the skeleton of the language. Everything above is attached to it.
N4: the verb system arrives
て-form in earnest and everything that attaches to it — 〜てもいいですか, 〜てはいけません, 〜ています. Plain form. ない-form and た-form. Obligation (〜なければなりません), experience (〜たことがあります), giving and receiving, simple conditionals, 〜ようと思います.
N4 is where Japanese verbs become a system rather than a set of endings. If conjugation is still something you calculate rather than produce, that is the work.
N3: combination
Conditionals in their varieties, passive, causative, and the beginnings of honorific and humble forms. Longer subordinate clauses. Constructions that combine two or three points in a single sentence.
The change here is that grammar stops arriving one point at a time. A sentence carries several, simultaneously, at speed.
N2: discrimination
This is the real change, and it is not about learning more.
At N2 you are given four forms that all approximately mean “although”, or “as soon as”, or “based on”, and asked which fits. They differ in register, nuance and formality, not in dictionary meaning.
That is a different kind of knowledge. It resists flashcards, because a card with one form on it cannot teach you the contrast. Study near-synonyms side by side, in example sentences, noting what each implies about the speaker and the situation. See N3 or N2.
N1: the written language
Formal and literary constructions, many rare in speech and standard in writing. Classical remnants. Set expressions from academic and bureaucratic prose.
Much of N1 grammar is best absorbed through reading real material rather than through grammar books, because the point of it is that it belongs to particular registers, and registers are learned by exposure.
How to study grammar at any level
In sentences you could say aloud. A form you can recognise in a table and not process in real time is not yet usable.
Through input. Reading and listening deliver grammar at natural speed with everything else attached. Drills teach you to recognise a form when you are looking for it; the exam never tells you to look.
By contrast, from N2 onwards. Alone, each form seems clear. The exam presents them together.
By diagnosing your errors properly. When you get a practice question wrong, decide which it was: an unknown word, a misread structure, a timing failure, or carelessness. Only the second is a grammar problem. Most candidates label all four as grammar and study the wrong thing for months.
For JFT-Basic
Much less, and used rather than recited: particles, verb forms, negatives, and the handful of set workplace expressions. The single highest-value point is までに versus まで. See the grammar you need for JFT-Basic.