There's no way for anyone to know 100% of the lifespan that T Rex lived on the planet earth.
But it's believed that Dinosaurs including the T Rex may have lived on earth as long as 100 to 152 years depending on the species of the Dinosaur.
Dinosaurs were on earth as long as 66 million years ago so it's very hard to say but the average lifespan of a T Rex was around 100 to 152 years.
The T Rex was the last of the big dinosaurs that lived on earth.