RGB vs. CMYK

Which one should I use and when?