1. When it needs it
You know your ends need a trim when they are looking worn out, dry and frizzy. If you don't get rid of those ends they will end up breaking on their own and this normally leads to more split ends, unkempt looking hair, tangling and even more breakage!
2. To keep it neat
If your hair isn't broken or has split end but it looks uneven and messy give it a trim.
3. To stop the ends from getting damaged
I made the mistake of over trimming! Every time I washed my hair, I was cutting the ends off because they were tangled and hadn't been combed through properly. This is not necessary at all; use a good quality detangler. Also, what would be better is "dusting" the ends.
"Dusting" involves trimming so little hair that it looks like dust. This technique helps to stop split ends from happening at all. You can dust every 6 to 8 weeks. Seriously, snip off a tiny, inconsequential amount.
That said, if your ends are damaged you cannot run away from giving your hair a proper trim!