Is life imprisonment in accord with Catholic social doctrine? I recall hearing an old religious sister talking on Relevant Radio a few years ago about her experience in Mexican prison ministry.  She said that life imprisonment is just as bad as the death penalty and that's why they don't have it in Mexico*.  

Is there any Catholic Church document, application to the natural law or other teaching regarding a just length of sentencing?

*I have no knowledge of Mexican law, so I don't know if this is true or not today
The Church has always upheld the State's right to protect its citizens, so my take on it is yes, life sentences are in accord as long as that is truly what is required to protect the people. Each specific case has to be considered individually, of course.

[Edit]
I've done some research in an attempt to find sources. Here is an interesting one:
Catholic Social Teaching and Capital Punishment

True, this is Capital Punishment centric, but some of the themes expressed hold, I believe. For example, you'll find expression that the state has not only the right, but the duty to protect its citizens. It goes on to say:


  If, however, non-lethal means are sufficient to defend and protect people’s safety from the aggressor, authority will limit itself to such means. . . 


Since a life sentence in prison is a "non-lethal" mean by which to protect the citizenry, then it follows it is not only acceptable, but preferable to Capital Punishment.

I doubt you'll find a document that says "Life sentences are OK" or "Life sentences are not OK". It's more an inductive approach to deciphering the social teachings, as many of the social teachings are.