The sequence of tenses (known in Latin as consecutio temporum, and also known as agreement of tenses, succession of tenses and tense harmony) is a set of grammatical rules of a particular language, governing the agreement between the tenses of verbs in related clauses or sentences.
A typical context in which rules of sequence of tenses apply is that of indirect speech. If, at some past time, someone spoke a sentence in a particular tense (say the present tense), and that act of speaking is now being reported, the tense used in the clause that corresponds to the words spoken may or may not be the same as the tense that was used by the original speaker. In some languages the tense tends to be "shifted back", so that what was originally spoken in the present tense is reported using the past tense (since what was in the present at the time of the original sentence is in the past relative to the time of reporting). English is one of the languages in which this often occurs. For example, if someone said "I need a drink", this may be reported in the form "She said she needed a drink", with the tense of the verb need changed from present to past.
The "shifting back" of tense as described in the previous paragraph may be called backshifting or an attracted sequence of tenses. In languages and contexts where such a shift does not occur, there may be said by contrast to be a natural sequence.