AT&T keeps the details of your text messages for a period of 7 years but the actual content of the text messages are only kept for 3 to 5 days and then it's lost forever.
So law enforcement can go to AT&T if they're wanting or needing too and see the details of your text messages as far as 7 years into the future but they won't be able to actually see the content of your text messages after 3 to 5 days.