All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger. We ask Allaah to exalt his mention as well as that of his family and all his companions.
If your grandmother is as you mentioned in the question that she sometimes loses her memory and does not know her obligations, then she does not have to pray as long as she is in this state. The Prophet said: "The pen is lifted (stopped from writing the deeds) from three kinds of people: the sleeping person until he wakes up, the mentally-handicapped or insane person till he becomes able to reason, and the child till he grows up (reaches the age of puberty)." [Al-Bukhari and An-Nasaa'ee] So in this case she does not have to expiate for not praying and there is no evidence in the Book of Allaah or the Sunnah about what your relative said to you. However, if your grandmother sometimes regains consciousness but loses her consciousness at other times, then she has to perform the prayer when she is conscious according to her ability. If she cannot pray standing, she can pray sitting, and if she cannot pray sitting she can pray lying on one side according to her ability. The evidence about this is the narration of the Prophet as he said to Imraan Ibn Husseyn : "Pray standing, however if you are unable, then pray sitting, and if again you are unable, pray lying down." [Al-Bukhari] Besides, Allaah says (which means): {Allaah burdens not a person beyond his scope.}[2:286]. So, she has to make up any prayers that she had not performed while she was conscious. Remind her lovingly about this obligation and help her to do so. As regards the ruling about whoever deliberately abandons the prayer without any sound religious reason, then you can refer to Fatwa: 84235. Such person (who deliberately abandons prayer) has to repent to Allaah, and according to the opinion of the scholars who consider him as a non-Muslim, he does not have to make up the prayers that he had deliberately abandoned. Besides, there is no expiation for abandoning the prayer, but one has to repent and perform the prayers.
Allaah knows best.