It's valid indefinitely; however, if you leave the UK for more than 2 years, you aren't considered resident anymore and the visa will no longer be valid. If you wanted to return to the UK, you would need to begin the visa process from the beginning, and requalify for ILR by whatever rules are in place at the time.