Politeness in referring to a recent death
TL;DR

The most general euphemism for "die" in Chinese is


  去世
  
  Literally means "leave the world". Similar to the English expression "pass on/away".


It would be polite enough to address anyone's death and is commonly used in speaking and writing. So if you don't know which word is the best, just use this one – in only a few cases would it sound unsuitable (even though it won't sound impolite), e.g.


When using euphemism is absurd. For example, it's weird to say

(Awful!) 这个专门杀男孩的杀手终于去世了。
(Awful!) Finally, the serial killer who aims at boys has passed away.


As you wouldn't say that in English, don't try it in Chinese.
When addressing children's death. Chinese consider 去世 is too solemn for children, and in formal writing we use 夭折. In conversations, personally I might (I hope there's no chance for me) say 离开了我们 (has left us).


A Longer List


General (for grown-ups)


  
  (leave the world; leave forever) 去世/过世/离世/谢世/辞世/与世长辞 / [长逝/永逝]
  (sleep forever; rest in peace; say farewell forever) 安息/永眠/长眠/永别
  

For children and youths


  夭折/夭亡/早逝 / [殤/兰摧玉折]

For young girls


  香消玉殒/倩女离魂

For the great


  逝世/辞世/与世长辞/ [星陨]

For martyrs


  牺牲/就义/殉道/殉国/殉难/殉职/壮烈/舍身 [成仁/以身许国/舍生取义/马革裹尸]

For those who die for illness


  病故/病逝

For ancient emperors


  驾崩/ [大薨/山陵崩/登遐/晏驾]

For Buddhist monks


  圆寂/坐化/涅槃 [示寂/示灭/入灭/灭度/示灭]

For those who die for accidents


  遇难/罹难/丧身

For those who normally die at an old age


  寿终/寿终正寝

For old masters (these phrases are Taoism related)


  驾鹤西去/仙去/仙游/ [登仙/物化/羽化/遁化/迂化/迂神/隐化/解驾]



Note:


Brackets [ ] denote expressions that would be too formal to be used in conversations.
This list is far from and is not supposed to be perfect (as expressions are too many). Feel free to improve it :)