Well, it's completely up to you. There can be many reasons to give up on training someone.
Most of them come from your own objectives. If you're training an NT player, you'll have to train him at least to age 25. Then you'll choose wether it's fun for you to wait 6 weeks for a pop in a certain skill. If it is, you'll train till he caps - then you'll have to consider if you want to wait 12+ weeks for a single pop. And if you find it being too long of a wait, you start a new project. Same goes with trainees you want to reach Div 1 with.
Some people train only for U21. So they train, and sell the trainees at the age of 21. It's a rather profitable way of training.
In general, to evaluate if you should or should not continue with a certain player, I'd think about:
1) if a season of training will up his value more than selling him at a younger age
2) if waiting 6 weeks makes it feel worth for you. If you like the player he's become and you still want to make him better (while he can win you divisions), you keep him. If he cant carry you or it's not as fun anymore, you dump it.
3) sometimes salary is an important factor.