Y is for capacitors where failure may cause electric shock. eg line to ground/chassis or to coupled circuits like antenna cables. Typically they are lower capacitance so that their reactance at 50hz is higher , to stop 'tingles' and possibly tripping earth leakage detectors
X is capaticors whose failure wont cause a shock eg across the line.
There are muliple X and Y ratings indicating better construction HV test etc.
Heres a link I found on a quick search on "capacitor class X2 X3"
http://my.execpc.com/~endlr/line-filter.html.
Ian VK3KRI