Here is what the Catechism of the Catholic Church has to say on the subject of torture:
Kidnapping and hostage taking bring on a reign of terror; by means of threats they subject their victims to intolerable pressures. They are morally wrong. Terrorism threatens, wounds, and kills indiscriminately; it is gravely against justice and charity. Torture which uses physical or moral violence to extract confessions, punish the guilty, frighten opponents, or satisfy hatred is contrary to respect for the person and for human dignity. Except when performed for strictly therapeutic medical reasons, directly intended amputations, mutilations, and sterilizations performed on innocent persons are against the moral law (CCC 2297; emphasis added).
In times past, cruel practices were commonly used by legitimate governments to maintain law and order, often without protest from the pastors of the Church, who themselves adopted in their own tribunals the prescriptions of Roman law concerning torture. Regrettable as these facts are, the Church always taught the duty of clemency and mercy. She forbade clerics to shed blood. In recent times it has become evident that these cruel practices were neither necessary for public order, nor in conformity with the legitimate rights of the human person. On the contrary, these practices led to ones even more degrading. It is necessary to work for their abolition. We must pray for the victims and their tormentors (CCC 2298).
The Catechism is not as specific as we might like on what physical or psychological pressures constitute torture. It limits itself to defining torture as “physical or moral violence” used to “extract confessions, punish the guilty, frighten opponents, or satisfy hatred.” Whether some of the hypotheses you offer (e.g., sleep deprivation, inclement temperatures, annoying noises) satisfy this condition is something moral theologians have yet to settle definitively. In the meantime, we might look instead to what constitutes legitimate self-defense.
The Catechism states that individuals have the right to protect themselves or others when lives are endangered (cf. CCC 2264); indeed, it also says that civil states have the right to defend their societies from unjust aggressors (cf. CCC 2263). Although the Catechism warns that persons and societies should limit themselves to only that violence necessary for self-defense, it does not rule out lethal violence if such is necessary to protect innocent lives.
This still does not answer the original question of whether torture is legitimate when used to defend innocent lives because we do not, as yet, have a definitive understanding of what constitutes torture and whether all violence that appears to be torture actually is torture. In other words, just as not all that appears to be stealing actually is stealing (e.g., a destitute person takes a loaf of bread to feed his family from a rich person), it may be that not all acts that appear to be torture indeed are torture. Given modern political realities, we may hope that this is a problem on which the Church will eventually hammer out a deeper understanding.
Just War Doctrine
What About Torture?** by Jimmy Akin