Tense is the grammaticalisation of temporal reference. Absolute tense relates a moment to the time of utterance or writing. So for a tense-prominent language like English, we have two morphological tenses: the past, indicating that a moment occurred before now, and the non-past tense, indicating it moment is now or in the future. It is debated whether the English auxiliary verb will should really be considered a future tense but from a functional perspective it fulfils the role of marking a moment after the time of utterance.
There is also relative tense which shifts the reference point away from the time of utterance. This is what the perfect in English does: it indicates that the moment happened prior to the primary tense. You can combine the perfect with all three tense options: the past (had), the present (have), the future (will have). In other words, it sets up a second level of relative time referencing. But it can also be used recursively. So with just one construction you can have recursive relative referencing:
By the time you read this I will have left by train, because I have never loved you, and I had lied when I said that I had fallen in love with you when I saw you the first time, but actually I had been spying on you for months because I had been sent after you because I had been recruited as a Soviet spy because I had a gambling debt because ...
But note that we wouldn't normally say that we have recursively generated tenses, each language still has a finite number of tenses which can be used recursively.