The duration of treatment with tamoxifen is typically five to ten years, depending on individual patient factors. Raloxifene is usually prescribed for a longer duration as part of ongoing osteoporosis management, often for several years, depending on the patient's risk profile and response to the therapy.