T-Mobile on Friday agreed to a $350 million settlement of a class-action lawsuit stemming from the 2021 cyberattack in which data relating to 76 million people was stolen.