We call it also 'indirect speech' and it is used to talk about different points in time in the past. When we use some verbal tenses in direct speech, the tense changes in reported speech in some cases:
There are some structures that do not change in reported speech:
When you use time and place markers you have to be careful, because they will be different in indirect speech:
Reported Speech Rules (British Council)
Reported Speech Statements (British Council)
Reported Speech Questions (British Council)
Daisy's Summer Job (Listening, British Council)
Reported Speech Activities (Pefect English Grammar)