This would be like, when to use a lever, for a mechanical system. It's really a generic question and has no legitimate answer, except that a resistor is used whenever you need to translate voltage to current, or current to voltage.
All the 1,000,000,000 uses of it follow from that.
I suggest a study of basic electronics. It will reveal areas of general application and more.