That is a word for word translation, but do Russians commonly say that? The forms of condolences that I have heard were quite different.
I have seen that ... The words I heard were more specifically religious: Царство ем Небесное (I think - I am backtranslating what I remembered it as). I am stretching my memory, which is why I did not suggest an alternative myself. I just remember being politely but firmly told that I shouldn't simply translate R.I.P. ("because we don't say that")
are there any contexts where one form is more acceptable than the other - for example, where you do not know the religious beliefs of the deceased?
Well, I'd say that "Царствие ей/ему Небесное" does have Christian overtones, so it's not likely to be used by atheists or people belonging to other confessions.
"Земля ей/ему пухом" is neutral. There's also "светлая ей/ему память", that is also neutral.
And is it only the recently deceased whom you should speak about in this way?
Not necessary. It can be inserted into any conversation where you mentioned the deceased regardless of how log ago they passed, but on the other hand you are not obliged to do that as well.
Моя бабушка, пусть земля ей будет пухом, bla-bla-bla. Equals: Моя бабушка, царствие ей небесное, bla-bla-bla...
Yes, "Царствие Небесное" is a short form of a pray "Упокой, Господи, душу раба Твоего новопреставленного, и прости ему вся согрешения его вольная и невольная и дáруй ему Царствие Небесное".
How common is this pattern of speech when referring to the deceased? And is it only the recently deceased whom you should speak about in this way?
Also, are there any contexts where one form is more acceptable than the other - for example, where you do not know the religious beliefs of the deceased?
Babushka, why are you leaving us? I will be longing for your handmade kompot and blini! Babushka, don't leave us!!! :'(
I wish I had бабушки, all I have are regular old grandmas
I also thought so at first, but if you listen to it carefully then you'll notice that there's no a between р and л .
Моя бабушка умерла дома, хотя была в больнице раньше. Это где она хотела умереть - дома. Это было её последнее желание.
i believe "passed away" should be a possible answer, but it isn't. Can you add it Duo ppl ? :") . (Saying someone died is bit harsh i think)
cancer and death are favorite themes of Duo developers. There's something wrong with their mental health.