Cancer patients may need to wear graduated compression stockings during periods of prolonged immobility, such as during and after surgery, while undergoing chemotherapy, or during hospital stays. It's crucial to wear them consistently as prescribed by a healthcare professional to ensure optimal benefits.