「[sentence]」+ と言う [verb (plain)] + と言う [i-adj] + と言う [na-adj] + だ + と言う [noun] + だ + と言う [noun] + という + [noun]
と言う reports what someone says: と marks the words, and ゆう言う is "say". The words can be a direct quote in 「 」, or reported speech in the plain form. The person who speaks takes は or が, and the person spoken to takes に.
Without 「 」, the words go into the plain form, and a noun or な-adjective needs だ before と: ×彼は学生と言いました. The tense is the one the speaker used, not shifted back as in English, so 学生だ stays 学生だ even though the sentence is in the past.
These go beyond reporting what someone said.
In writing, a sentence can end in という with no speaker named: "it is said", "according to the story". Conversation uses そうだ or らしい instead.