Lithium batteries last 5-10 years, regular 9v alkaline batteries last about 12-18 months. Some sources recommend changing the batteries every 6th month but i personally think that’s a bit excessive.
I only have a small 2 room apartment so i just got myself a cheap-ish optical smoke detector with a built in lithium battery. The battery should last 10 years which is how long smoke detectors last before they should be replaced.
Isabelle, just Isabelle