"Grammar" is the correct spelling of the word referring to the rules of a language. "Grammer" is a misspelling.