The Institution for the Feast of the Sacred Heart was a result of the appearances of our Lord to St. Margaret Mary Alacoque in 1675. St. Margaret Mary suffered contempt from many people who refused to believe the authenticity of the visions. In these appearances, Our Lord told her twelve graces that He would give to anyone devoted to His Sacred Heart. Yet, it was not until 1856 that the Feast of the Sacred Heart of Jesus was placed officially on the Church calendar. However, devotion to the Sacred Heart of Jesus dates back even to the Middle Ages.
In 1856, Pope Pius IX established the Feast of the Sacred Heart as obligatory for the whole Church, to be celebrated on the Friday after the Octave of Corpus Christi. Pope Pius XII raised the feast to the highest rank, Double of the First Class, and added an octave - that octave was later suppressed in the 1955 reforms, which removed all but three octaves.