SMOKE ALARMS should be replaced at least every 10 years. The sensors on smoke alarms are generally not designed to be reliable or effective after about 10 years. This is true both for hard-wired (interconnected) alarms and independent (single-station) alarms.
On the other hand, CARBON MONOXIDE (CO) ALARMS are only designed to work reliably for 5 to 7 years, which is shorter than the lifespan of a smoke alarm. So if you buy a combo smoke/CO alarm, follow the manufacturer’s instructions and replace it within 5 to 7 years.
Immediately replace any alarm (smoke or CO) that fails a push-button test after getting fresh batteries, or if it makes “end of life” chirps.