Yes, athletes know when to hang it up. While Ray Allen's representatives may be seeking a comeback for the athlete, this is not the case for all athletes. Some athletes are only seeking fame and accolades which encourages athletes to come out of retirement when they see an opportunity to gain recognition or a trophy to add to their shelf. Most athletes however, are not like that. They play the game because it's their passion and when they decide to retire, they do. Therefore, most athletes know how to hang it up.
Ray Allen might be past his prime, but that doesn't mean he doesn't have a few good years in him as an athlete. If he can keep playing comfortably, and he feels like it is time for him to come out of retirement he might just be in the shape he needs to be to do so.
Most athletes know when to hang it up. They judge themselves by how much they are contributing to the team and their fitness in general. Others will consider their career goals and will pursue them no matter what. Ray Allen'n ambitions of going back to Cleveland Cavaliers are highly valid.
"Do athletes know when to hang it up?" This statement implies that it is time for Ray Allen to retire. Is it? In my opinion, guys like David "Big Papi" Ortiz, Marshawn Lynch, and Ray Allen did not (and do not, in the case of Ortiz) need to retire when they chose to do so. With that being said, some guys like to go out on top, playing their best. However, if they can still perform not just adequately but above most of their peers, who are we to say that they should be done?