Can you tell me exactly when is radiation therapy used to treat cancer and when is chemotherapy used?

Local v. Systemic Rx. Cancer rx involves treating the organ where the cancer developed (local rx) as well as any cancer cells that may have broken away from the organ of origin and travelled elsewhere in the body (systemic rx). In general, surgery and radiation therapy are local rx whereas chemotherapy is designed to circulate throughout the body and kill cancer cells. Ideally, these 3 modalities work together for cure.
Guideline based. Some tumors respond better to one or the other, or they may need to be given together or sequentially. The choice is mostly based on standard guidelines (nccn) that are evidence based with some degree of physician or institutional variation.
It depends. In early stage cancer (more likely to be cured), radiation therapy is often used with chemotherapy and rarely by itself. Chemo can be used by itself for curative purpose. In advanced cancer (unlikely to be cured), radiation can be used with or without chemotherapy mainly to palliate or alleviate symptoms such as bone pain. Chemo by itself can be used to alleviate symptoms and/or prolong survival.