I think it depends on your reasons:
1. Religous- Sacrificing something in rememberance of God be you of any religion is usually considered great. What you don't want to do is harm yourelf. Anything over a week where you're not at least doing something liek what Muslims do for Ramadan (eating/drinking at night) is probably bad.
2. Secular Reasons- Fasting can be healthy and helps you focus. But just as in the Religious reasons there is no need to harm yourself and at some point, the damage to your body out weighs the good it's doing you. No more than 5 Days to a week at most.
Hope this answers your question.