From the UKBA site
"Time spent outside the UK
The Immigration Rules do not say that you must have been in the UK for the entire 5 years of your visa or permission to remain. Your application to settle here will be judged on its merits, taking into account your reasons for travel, the length of your absences, and whether you and your partner travelled and lived together while you were outside the UK. If you have spent a limited time abroad in connection with your job, for example, this should not count against you.
However, time spent outside the UK does make a difference to applications for British citizenship. If you apply to be naturalised as the husband, wife or civil partner of a British citizen, you must show that you have been living in the UK for the last 3 years (the 'residential qualifying period'), and that you have spent no more than 270 days outside the UK during those 3 years. Also, you must have spent no more than 90 days outside the UK in the last 12 months of the 3-year period. (We have discretion to allow absences above the normal limits in some circumstances.)"