Short answer. A roof's tax depreciation life depends on the property: 27.5 years on residential rental property, 39 years on nonresidential property or a home office portion, and none on a personal residence. In every case the roof is treated as part of the building rather than as a separate shorter-lived asset.
Quick reference
Primary home: not depreciable; add the cost to your basis.
Second home used personally: not depreciable.
Long-term residential rental: 27.5 years, straight-line, mid-month.
Home office portion of your home: 39 years on the business percentage.
Commercial or mixed-use building that fails the residential test: 39 years, with possible Section 179 expensing for roofs.
Common mistakes
Depreciating a roof over its expected shingle life, such as 20 or 25 years. The IRS uses the building's period.
Treating a roof as 15-year qualified improvement property. Roofs are not interior improvements, so they do not qualify.
Expensing a full replacement as a repair without checking the improvement rules.
Forgetting the partial disposition election on the old roof.
Different from insurance depreciation
Insurance depreciation values a roof on a claim using its age and expected life. It does not affect your tax return, and your tax schedule does not affect your claim. A roof that is barely depreciated on a rental's tax schedule can still be heavily depreciated on a hail claim.