Your debts and collections will remain on your credit report. Most items ranging from bankruptcies to collections will remain on your credit report for 7 years. It impacts different credit scores differently as well. For example, if you are looking at your FICO score, then the age of the bad debt or collections account will have less impact the older it is, compared to other credit scores who do not take that into account. Bankruptcies can vary as well, where Chapter 10 remains for 7 years, Chapter 7 will remain on your credit report for 10 years.
Placing a credit freeze allows you to restrict access to your credit report. This is important after a data breach or identity theft when someone could use your personal information to apply for new credit accounts. Most creditors look at your credit report before opening a new account. But if you've frozen your credit report, creditors can't access it, and probably won't approve fraudulent applications.