"The state or quality of being grammatical," or "grammatical correctness" is known as:
grammaticality.
Dictionary.com
And Mithrandir has provided the adjective form in Mithrandir's answer above.
For example:
Grammatical correctness is also known as grammaticality.
Grammatical correctness as related to the way you write is also known as grammaticality.
"In...linguistics...a grammaticality judgement...is based on whether the sentence is produced and interpreted in accordance with the rules and constraints of the relevant grammar" ("Grammaticality," Wikipedia).
"The grammaticality of a sentence is things that conform to the linguistic rules or syntactic rules (Fromkin and Rodman 1998:106) ("The Grammaticality versus The Acceptability," Linguistik.)
grammatical without 'correctness'?
of or relating to grammar:
grammatical analysis.conforming to standard usage:
grammatical speech.
-dictionary.com
dictionary.com gives 'antigrammaticalness, noun' as a related word, so I assume that if you remove the 'anti' that gives 'grammaticalness', which should work as a noun.
There isn't really a word that refers to those three things and no others.
Grammar is not a part of writing. It's part of language, which is spoken.
Spoken language, of course, doesn't have any punctuation or spelling, but it does have grammar. And there are a lot of other things that go into writing besides spelling and punctuation.
I fear someone has been misinforming you.
Teachers who assign student writing typically use some kind of rubric listing the various criteria by which the grade for the work is to be calculated. A common term for the criterion that includes grammar, spelling and punctuation is mechanics.
Here are is an extract from the online writing rubric by readwritethink under the criterion Mechanics:
Level 1 = Minimal : Many spelling, grammar, and punctuation errors; sentence fragments; incorrect use of capitalization
Level 4 = Outstanding : Correct spelling, grammar, and punctuation; complete sentences; correct use of capitalization
And here is an one from longwood.edu under the criterion Writing mechanics (Grammar, Spelling, Punctuation, Citations)
Level 4: The student uses correct grammar, makes essentially no errors of spelling or punctuation, and formats citations (if any) correctly.
Level 0: The writing's low-level mechanics are so poor that the language is incoherent and difficult to understand.