Here's a simple explanation.
やめる = quit
If the word "quit" would make sense in English, use やめる. If the word quit would sound wrong or unnatural in English, use とめる.
* You can quit watching TV, so やめる
* You can quit smoking, so やめる
* You cannot quit your car in an intersection, so とめる
* You cannot quit your TV, so とめる
Note that the first and last examples are different. "Quit watching TV" is fine. "Quit the TV" is not fine. In the second sentence, using とめる has the meaning of "turn off".
At least that's how i understand it. When you're talking about quitting your job, though, there's yet another character with the same yameru pronunciation: 辞める. Japanese writing seems so haphazard (especially compared to Mandarin/Cantonese)...