When it is said
In the Gelasian book it is the prayer of a Mass for one who has died, said on the yearly anniversary of the death.
The Orthodox keep that day with a memorial service. This prayer can be said beside it, at home or at the grave, with the name of the one who died.
Where it comes from
No author known
A Mass for the days after a death
The Gelasian Sacramentary is a Roman service book that survives in one copy, made near Paris about AD 750 from older Roman material. Its Mass for one who has been laid to rest names the third, seventh and 30th days after the death, and the yearly anniversary. This short prayer is the one written for the anniversary.
H. A. Wilson, The Gelasian Sacramentary (1894), page 312; University of Oxford, The Cult of Saints, E07005
The third, ninth and 40th days
The Orthodox keep the third, ninth and 40th days after a death and every anniversary. These are the days named in the Apostolic Constitutions, an early Church order. It keeps the third day for Christ, Who rose on the third day, and the 40th for the people’s mourning for Moses. It also asks that gifts be given to the poor from what the departed left, in their memory.
Apostolic Constitutions, Book 8, chapter 42 (Ante-Nicene Fathers, volume 7); Pravoslavie.ru, the remembrance of the departed (Russian)
Rest and refreshment
The early Christian writer Tertullian described how a faithful widow remembers her dead husband. She “prays for his soul, and requests refreshment for him”, and makes her offering “on the anniversaries of his falling asleep”. Tertullian’s Latin word for that refreshment, refrigerium, is the word this prayer uses. The Orthodox prayer for the departed asks rest “in a place of refreshment” too.
Tertullian, On Monogamy, chapter 10 (New Advent); Tertullian, De Monogamia (Latin); Greek Orthodox Archdiocese of America, the Trisagion for the departed (Greek)
In Latin
Deus, indulgentiarum Domine, da famulo tui N.,
cuius anniversarium depositionis diem commemoramus,
refrigerii sedem, quietis beatitudinem, luminis claritatem largiaris.
Per.
From the Gelasian Sacramentary, edited by H. A. Wilson (Oxford, 1894), Book III, page 312.