Saying or repeating exactly what someone has said is called Direct Speech (which is sometimes also called Quoted Speech).
What a person says appears within quotation marks and is exactly what that person says:
“Live long and prosper,” said Spock.
In this example above, we are repeating exactly the words which Spock said earlier. You can contrast this with Indirect Speech which is reporting what the person said at a later date. Sometimes words are changed here and when we write it, no quotation marks are used:
Spock said we should live long and prosper.
Punctuating Direct Speech – how to punctuate direct speech.