Others have already given good references, but it may be a bit difficult to take them all in at first. So let me try to present a brief summary.
X and Y capacitors are intended for use at mains AC voltages and frequencies. They are made to withstand AC which is more stressful then DC of the same voltage. They are non-polar, that is, they do not have + and - terminals.
X capacitors are general-purpose and are intended for use where a short-circuited capacitor is not likely to pose danger to humans.
Y capacitors are specially made in such a way that they are not likely to be short-circuited even if they fail. This makes them safer for use in certain applications.
Electrolytic capacitors use electrolytes. They are polarised and must be used in the correct polarity. The electro-chemical action makes it possible to make compact capacitors of the same capacitance and voltage ratings compared to non-electrolytics. Advantages: Small size and low cost, available up to thousands of microfarads. Disadvantages: High leakage, wide tolerance, high equivalent series resistance (ESR), change of capacitance with time and temperature, poor high-frequency performance.
Ceramic capacitors are non-polarised. Advantages: Good high-frequency performance, compact size and low cost. Disadvantages: wide tolerance, poor temperature coefficient.
Tantalum capacitors are polarised. Advantages: Very compact size, better high-frequency performance than electrolytics (but poorer than ceramic or plastic types). Disadvantages: Higher cost than electrolyics, wide tolerance and poor temperature coefficient, subject to catastrophic failures.
There are many other details that I have not covered here, This was intended to give a brief overall picture.