Because every smoke alarm and battery manufacturer's product varies slightly, it is difficult to give a precise time frame for the life of your 9V battery. Energizer, a battery manufacturer, categorizes smoke alarms as "low-drain devices," meaning you can expect the longest possible battery life. Expect batteries to last at least a year under normal circumstances.
Many modern smoke alarms chirp intermittently when the battery power starts to wane. Press the "Test" button on the underside of the alarm; you should hear a sample of the noise for as long as you hold down the button. This indicates the alarm is ready for use.
It's good to have a regular event you associate with your smoke alarm. Consider changing the battery regardless of remaining power every time you adjust the clocks during Daylight Savings Time. If you don't use this system, make sure you change the battery at least every six months.
Other than an occasional battery change, smoke alarms don't need much maintenance. Vacuum any cobwebs or dust on the smoke alarm when you change the battery because debris can sometimes clog the smoke detector.
You should replace you smoke alarm every 10 years regardless of its working order. If the alarm doesn't sound when you change the battery and press the "Test" button, your unit is defective and should be replaced immediately.