There isn't a specific time length for a diet phase that can be considered too long. However, it's essential to keep your diet sustainable, and having frequent and planned diet breaks is a helpful method for achieving that. I recommend people take a two-week diet break every 6–16 weeks. The total length of your diet will depend on how much fat you carry. It's fine to diet for however long it takes to no longer be in an "at-risk" health category. You can continue to do so until you have achieved your desired level of leanness.