If you have Indefinite Leave to Remain (ILR) when leaving the UK to reside elsewhere, you must return to the UK to re-settle within two years or your ILR becomes invalid, you lose your status.
Section 18 of the Immigration Rules1:
A person seeking leave to enter the United Kingdom as a returning resident may be admitted for settlement provided the Immigration Officer is satisfied that the person concerned:
(i) had indefinite leave to enter or remain in the United Kingdom when he last left; and
(ii) has not been away from the United Kingdom for more than 2 years; and
(iii) did not receive assistance from public funds towards the cost of leaving the United Kingdom; and
5
(iv) now seeks admission for the purpose of settlement.
If you intend to leave for longer than two years, it is advised to become naturalised (get your British Citizenship) and aquire a UK passport before you leave (or from abroad via an embassy). You cannot occassionally visit to get your passport stamped in order to revalidate/extend your ILR.
There are rare exceptions to the two year rule, described in the Rules.