Wiktionary
n. (context of language English) The state or attribute of obeying the rules of grammar; grammatical correctness.
Wikipedia
In theoretical linguistics, a speaker's judgement on the well-formedness of a linguistic utterance—called a grammaticality judgement—is based on whether the sentence is produced and interpreted in accordance with the rules and constraints of the relevant grammar. If the rules and constraints of the particular language are followed then the sentence is considered to be grammatical. In contrast, an ungrammatical sentence is one that violates the rules of the given language.
Linguists use grammaticality judgements to investigate the syntactic structure of sentences. Generative linguists are largely of the opinion that for native speakers of natural languages, grammaticality is a matter of linguistic intuition, and reflects the innate linguistic competence of speakers. Therefore, generative linguistics attempts to predict grammaticality judgements exhaustively. On the other hand, for linguists who stress the role of social learning, in contrast to innate knowledge of language, such as Hopper 1987 there has been a gradual abandonment of talk about grammaticality in favour of acceptability.