The First Vatican Council's Pastor Æternus said, under Pope Pius IX's authority, regarding papal infallibility:
…we teach and define that it is a dogma divinely revealed: that the
Roman Pontiff, when he speaks ex cathedra, that is, when in
discharge of the office of pastor and doctor of all Christians, by
virtue of his supreme Apostolic authority, he defines a doctrine
regarding faith or morals [de fide vel moribus] to be held by the universal Church, by the
divine assistance promised to him in blessed Peter, is possessed of
that infallibility with which the divine Redeemer willed that his
Church should be endowed for defining doctrine regarding faith or
morals; and that therefore such definitions of the Roman Pontiff are
irreformable of themselves, and not from the consent of the Church.
There are three levels of de fide ("of the faith") truths:
Theological note: Dogma.
Equivalent terms: Dogma of faith; de fide, de fide Catholica; de fide divina et Catholica.
Explanation: A truth proposed by the Church as revealed by God.
Examples: The Immaculate Conception; all the contents of the Athanasian Creed.
Censure attached to contradictory proposition: Heresy
Effects of denial: Mortal sin committed directly against the virtue of faith, and, if the heresy is outwardly professed, excommunication is automatically incurred and membership of the Church forfeited.
Remarks: A dogma can be proposed either by a solemn definition of pope or council, or by the Ordinary Magisterium, as in the case of the Athanasian Creed, to which the church has manifested her solemn commitment by its long-standing liturgical and practical use and commendation.
Theological Note: Doctrine of ecclesiastical faith
Equivalent term: De fide ecclesiastica definita
Explanation: A truth not directly revealed by God but closely connected with Divine revelation and infallibly proposed by the Magisterium.
Example: The lawfulness of communion under one kind.
Censure attached to contradictory proposition: Heresy against ecclesiastical faith.
Effects of denial: Mortal sin directly against faith, and, if publicly professed, automatic excommunication and forfeiture of membership of Church.
Remarks: It is a dogma that the Church's infallibility extends to truths in this sphere, so one who denies them denies implicitly a dogma or Divine faith.
Theological Note: Truth of Divine faith.
Equivalent term: De fide divina.
Explanation: A truth revealed by God but not certainly proposed as such by the Church.
Example: Christ claimed from the beginning of His public life to be the Messias.
Censure attached to contradictory proposition: Error (in faith).
Effects of denial: Mortal sin directly against faith, but no loss of Church membership. May incur a canonical penalty.
source: Sixtus Cartechini, S.J.'s 1951 work De Valore Notarum Theologicarum (On the Value of the Theological Notes), which confessors have used when dealing with erudite penitents. (It's also available in Italian translation.) The theological notes are a way of classifying the proximity of a theological proposition to revelation. (For a good history of the development of these notes, see The development of the theological censures after the Council of Trent: (1563-1709) by John Cahill, O.P.)
Morals ("Etym. Latin moralis, relating to conduct, mos, a manner, custom") are voluntary acts (i.e., acts pertaining to the will). Since the will follows the intellect by necessarily desiring the good that the intellect presents it (cf. Thomistic thesis #21), morals always have a doctrinal basis.
Pope Pius XI's condemnation of onanism (contraception) in his 1930 encyclical Casti Connubii (spec. §59: "…so long as the intrinsic nature of the [marriage] act is preserved.") is a case study of Fr. Cartechini's De Valore Notarum Theologicarum p. 20 regarding ex cathedra pronouncements of morals:
De qualificatione theologica sententiæ condemnatoriæ abusus matrimonii in encyclica "Casti Connubii": utrum sit solemnis definitio ex cathedra quod onanismus sit semper peccatum mortale. Quidam affirmabant esse dogma quia Pontifex adhibet verba satis solemnia. Certe ad solemnem definitionem requiruntur hæc elementa: quod loquatur ut supremus pastor et doctor, et quod velit adhibere supremam suam auctoritatem in pleno gradu. Quod hic loquatur ut supremus pastor et doctor patet; inquirendum restat utrum voluerit uti sua suprema auctoritate, ferendo sententiam definitivam. Sed, admisso quod non sit dogma fidei, tamen doctrina ab ea promulgata certe est infallibiliter vera ex hoc capite: quod Papa verbis solemnibus authentice significet doctrinam ex antiquis temporibus ab ordinario et universali magisterio constanter propositam ut tenendam et observandam.
Regarding the theological qualification of the condemnations against the abuses of matrimony in the encyclical Casti Connubii: whether contraception is always a mortal sin is a solemn ex cathedra definition. Some affirm it to be dogma because the Pontiff uses very solemn words. For a solemn definition, these elements are required: that he speak as supreme pastor and teacher, and that he wants to use his supreme authority in its full degree. It is clear that he speaks as supreme teacher and pastor in this encyclical; it remains to inquire whether he wanted to use his supreme authority, giving a definitive pronouncement. But, even if it is not a dogma of the faith, the doctrine he promulgated certainly is infallibly true because the Pope authoritatively and with solemn words expresses a moral doctrine that from ancient times the ordinary and universal magisterium has constantly proposed must be be held and observed.
[my translation with comparison to p. 18 of the Italian]
This answer incorporates this answer to the question "Do the Catholic Church ex cathedra pronouncements about necessity of Catholicism to be saved still apply?"