The Yahrzeit originated as an Ashkenazic observance in the Middle Ages, although similar customs are observed by Sephardic Jews, some of whom refer to the anniversary of a death as nachalah (comfort). The Talmud, a central text in Rabbinic Judaism, references the concept of Yahrzeit, suggesting that remembering and reciting prayers for the deceased is a sacred obligation for mourners. Lighting the Yahrzeit candle is one way to fulfill this responsibility and keep the memories of the departed alive in the hearts of their loved ones.
Traditionally it is lit on the anniversary of the Hebrew date, not the Gregorian date. That is easy to figure out by going to a Hebrew - Gregorian calendar converter such as https://www.hebcal.com/converter. In addition to lighting the yahrzeit during the week of Shiva (mourning) and on the anniversary of the death of a loved one, it is also lit at sundown preceding the start of Yom Kippur and at sundown preceding the last day of Succot, Passover and Shavuot. In addition, many people light it on Yom Hashoah, Holocaust Rememberance Day.
Traditionally, mourners keep the candle lit for the entire 25 hours from sundown on the eve of the yahrzeit to sunset on the day of the yahrzeit. When the yahrzeit falls on Shabbat, it is customary to light the yahrzeit candle before lighting Shabbat candles.
Lighting a yahrzeit candle is a Jewish custom (minhag). While it is not required by Jewish law (halakhah), the custom of lighting yahrzeit candles has become deeply ingrained in Jewish life. Several websites, such as the National Jewish Memorial Wall and Virtual Yahrzeit maintain “virtual” walls and will send yahrzeit reminders for you free of charge.
In the synagogue, yahrzeit is observed by reciting the Mourner’s Kaddish at services. But at home there is no special prayer that must be recited while lighting a memorial candle.
In the tapestry of Jewish traditions, the Yahrzeit stands as a poignant reminder of the interconnectedness of life and death. Lighting the Yahrzeit candle symbolizes the enduring presence of departed souls in the hearts of their loved ones and the timeless connection shared between generations. It serves as a wonderful reminder of your loved one and the light that they were in your life.