You should replace your cleats as soon as they’ve worn out. The amount of time that takes will depend on many different factors: the brand, the amount of use, the riding style, how much you walk in your spin shoes, etc. When you notice they’re not connecting as effectively with the pedals, or it’s more difficult to release your feet, or you often pull your feet off the pedals by accident, it means it’s time to replace your cleats because they’re not working as effectively.