Grammar is the set of rules that governs how words are formed, arranged, and used to create meaningful sentences in a language. It includes parts of speech, tenses, sentence structure, punctuation, and subject-verb agreement.