Wiki article on this topic:
In linguistics, grammar is the set of structural rules governing the composition of clauses, phrases, and words in any given natural language. The term refers also to the study of such rules, and this field includes phonology, morphology, and syntax, often complemented by phonetics, semantics, and pragmatics.
Speakers of a language have a set of internalized rules for using that language, and these rules constitute that language's grammar. The vast majority of the information in the grammar is – at least in the case of one's native language – acquired not by conscious study or instruction, but by observing other speakers. Much of this work is done during early childhood; learning a language later in life usually involves a greater degree of explicit instruction. Thus, grammar is the cognitive information underlying language use.
The term "grammar" can also be used to describe the rules that govern the linguistic behavior of a group of speakers. The term "English grammar", therefore, may have several meanings. It may refer to the whole of English grammar, that is, to the grammars of all the speakers of the language, in which case, the term encompasses a great deal of variation. Alternatively, it may refer only to what is common to the grammars of all, or of the vast majority of English speakers. Or it may refer to the rules of a particular, relatively well-defined variety of English.
A specific description, study or analysis of such rules may also be referred to as a grammar. A reference book describing the grammar of a language is called a "reference grammar" or simply "a grammar". A fully explicit grammar that exhaustively describes the grammatical constructions of a particular lect is called a descriptive grammar. This kind of linguistic description contrasts with linguistic prescription, an attempt to discourage or suppress some grammatical constructions, while codifying and promoting others, either in an absolute sense, or in reference to a standard variety. For example, preposition stranding occurs widely in Germanic languages, has a long history in English, and is generally considered standard usage. John Dryden, however, objected to it , leading other English speakers to avoid the construction and discourage its use.