From Pope Pius XI’s encyclical Quas Primas (1925):
Therefore by Our Apostolic Authority We institute the Feast of the Kingship of Our Lord Jesus Christ to be observed yearly throughout the whole world on the last Sunday of the month of October—the Sunday, that is, which immediately precedes the Feast of All Saints.* We further ordain that the dedication of mankind to the Sacred Heart of Jesus, which Our predecessor of saintly memory, Pope Pius X, commanded to be renewed yearly, be made annually on that day. This year, however, We desire that it be observed on the thirty-first day of the month on which day We Ourselves shall celebrate pontifically in honor of the kingship of Christ,** and shall command that the same dedication be performed in Our presence. It seems to Us that We cannot in a more fitting manner close this Holy Year, nor better signify Our gratitude and that of the whole of the Catholic world to Christ the immortal King of ages, for the blessings showered upon Us, upon the Church, and upon the Catholic world during this holy period.
— Quas Primas 28
* The Feast of Christ the King is traditionally celebrated on the Sunday before All Saints’ Day. In the Novus Ordo calendar the feast is assigned to the last Sunday of the liturgical year.
** I.e., on December 31 of the Holy Year 1925, with subsequent celebrations to take place on the last Sunday of October of each succeeding year.