Grammar is the set of rules that dictate how words are organized and combined to form sentences in a language. It includes rules for sentence structure, word order, punctuation, and usage. For example, in English, the grammar rule for forming a question is to invert the subject [person or thing doing the action] and the auxiliary verb [small verb like is, do, are etc.], as in “Are you going?” (instead of “You are going?”).
Very Simple Definition:
Grammar is a set of rules that tells us how to put words together to make sentences. We use grammar to know where to put words in a sentence and how to ask questions. For example, when telling something we say it in a different order than when we ask (“You are going.” compared to “Are you going?”). This is one of the rules of grammar.