The duration of tamoxifen treatment can vary. For breast cancer treatment, it is often prescribed for 5 to 10 years, depending on the patient's risk factors and response to the medication. For fertility treatment, the duration may be shorter, typically around 5 days during the menstrual cycle. Your healthcare provider will determine the appropriate length of treatment based on your individual needs.