It's mentioned whenever the suttas talk of the benefits of practicing the Uposatha. The Anguttara has a lot of examples that can give you exact lifespans for the devas of the sensual realm:"Fifty human years are equal to one day & night among the Devas of the Four Great Kings. Thirty such days & nights make a month. Twelve such months make a year. Five hundred such heavenly years constitute the life-span among the Devas of the Four Great Kings."AN 3.70: Muluposatha SuttaAN 8.43: Visakhuposatha Sutta
When it comes to the form realm, the suttas only talk of lifespan in terms of kappas (eons):The devas of Brahma's retinue, monks, have a life-span of an eon.AN 4.123: Jhana Sutta
From what I've read, only the formless realms and the hells realms are left without explicit mention of lifespans. I think the commentaries give lifespans in eons for the formless realms (something like 84,000 eons in the highest formless realm). Also the suttas state that the lifespans in hell realms can be extremely long or short depending on the kamma.