Grammar is a set of rules that set forth the correct standard of usage in a language. These rules dictate how we should say things correctly. For example, agreement between words in relation to other constructions in the sentence.
Syntax is the study of sentences and their structure, and the constructions within sentences. Syntax tells us what goes where in a sentence.