I am starting this thread on papal infallibility since it seems that many have quite a confusion on what it is and when it is applicable. I will give quotes from books and references that I have found most useful in explaining what it means when we as Catholics state that the pope is infallible.
First of all Papal infallibility was believed by Catholics before Vatican I. But it was not until then that it became a dogma. For that reason let us start by describing what Vatican I had to say about papal infallibility.
Vatican I: Therefore, faithfully adhering to the tradition received from the beginning of the Christian faith, to the glory of God our savior, for the exaltation of the Catholic religion and for the salvation of the Christian people, with the approval of the Sacred Council, we teach and define as a divinely revealed dogma that when the Roman Pontiff speaks EX CATHEDRA, that is, when, in the exercise of his office as shepherd and teacher of all Christians, in virtue of his supreme apostolic authority, he defines a doctrine concerning faith or morals to be held by the whole Church, he possesses, by the divine assistance promised to him in blessed Peter, that infallibility which the divine Redeemer willed his Church to enjoy in defining doctrine concerning faith or morals. Therefore, such definitions of the Roman Pontiff are of themselves, and not by the consent of the Church, irreformable.
Thus this means that the pope is infallible when he speaks Ex Cathedra. This means that the Pope speaks in behalf of not only a group of Catholics, or nation, but over the whole Church as the Supreme Pontiff, and that he speaks with utmost authority, and defines a dogma within the area of faith and moral then he is infallible. Thus not everything necessarily that comes out of the popes mouth is necessarily infallible. Say the pope speaks about the economy. Thus the pope could also say something regarding faith or morals whether in private, or in writing that is wrong and contains error. Yet this would not be true if the pope happens to be exercising Ex Cathedra. Since the pope is not speaking humanely anymore but it is the Holy Spirit speaking through the pope.
Thus there have been popes that have privately fallen into heresy whether by letter or action such as Pope John XXII, or Pope Honorius. This is described in Saint Francis de Sales’ book The Catholic Controversy
The Catholic Controversy Chapter XIV
Thus we do not say that the Pope cannot err in his private opinions, as did John XXII.; or be altogether a heretic, as perhaps Honorius was. Now when he is explicitly a heretic, he falls ipso facto from his dignity and out of the Church, and the Church must either deprive him, or, as some say, declare him deprived, of his Apostolic See, and must say as S. Peter did: let another take his bishopric. When he errs in his private opinion he must be instructed, advised, convinced; as happened with John XXII., who was so far from dying obstinate or from determining anything during his life concerning his opinion, that he died whilst he was making the examination which is necessary for determining in a matter of, as his successor declared in the Extravagantes which begins Benedictus Deus.
But when he is clothed with the pontifical garments, I mean when he teaches the whole church as shepherd , in general matters of faith and morals, then there is nothing but doctrine and truth.
So everything the Pope says is not canon law or of legal obligation; he must mean to define and to lay down the law for the sheep, and he must keep the due order and form. Thus we say that we must appeal to him not as to a learned man for in this he is ordinarily surpassed by some others; but as to the general head and pastor of the Church; and as such we must honor, follow, and firmly embraced his doctrine, for then he carries on his breast the Urim and Thummim, doctrine and truth. And where his judgment is infallible, but then only when he gives judgment on a matter of faith in questions necessary to the whole Church.
Theologians have said, in a word, that he can err in questions of fact, not in questions of right; that he can err extra cathedram, outside the chair of Peter, that is, as a private individual, by wrings and bad example. But he cannot err when he is in cathedra, that is, when he intends to make an instruction and decree for the guidance of the while Church, when he means to confirm his brethren as supreme pastor, and to conduct them into the pastures of the faith.