20 CFR § 404.321 - When a period of disability begins and ends.
(a) When a period of disability begins. Your period of disability begins on the day your disability begins if you are insured for disability on that day. If you are not insured for disability on that day, your period of disability will begin on the first day of the first calendar quarter after your disability began in which you become insured for disability. Your period of disability may not begin after you have attained full retirement age as defined in § 404.409.
(b) When disability ended before December 1, 1980. Your period of disability ends on the last day of the month before the month in which you become 65 years old or, if earlier, the last day of the second month following the month in which your disability ended.
(c) When disability ends after November 1980. Your period of disability ends with the close of whichever of the following is the earliest—
(1) The month before the month in which you attain full retirement age as defined in § 404.409.
(2) The month immediately preceding your termination month (§ 404.325); or
(3) If you perform substantial gainful activity during the reentitlement period described in § 404.1592a, the last month for which you received benefits.
(d) When drug addiction or alcoholism is a contributing factor material to the determination of disability.
(1) Your entitlement to receive disability benefit payments ends the month following the month in which, regardless of the number of entitlement periods you may have had based on disability where drug addiction or alcoholism is a contributing factor material to the determination of disability (as described in § 404.1535)—
(i) You have received a total of 36 months of disability benefits. Not included in these 36 months are months in which treatment for your drug addiction or alcoholism is not available, months before March 1995, and months for which your benefits were suspended for any reason; or
(ii) Your benefits have been suspended for 12 consecutive months because of your failure to comply with treatment requirements.
(2) For purposes other than payment of your disability benefits, your period of disability continues until the termination month as explained in § 404.325.