The difference is subtle.

Synecdoche:

http://humanities.byu.edu/rhetoric/Figures/S/synecdoche.htm

A part for the whole: a head is part of a beef, wheels are part of a car.

Metonymy:

http://humanities.byu.edu/rhetoric/Figures/M/metonymy.htm

A pen is something used in writing down thoughts, but is not a part of thought. A crown is something worn by a ruler, but is not a part of a ruler.