They shed when they out-grow their old skin, & that depends on available food & enough warmth for digestion. Young snakes that are well-fed (as in captivity with good care) shed more frequently than older snakes, & they continue to shed their whole lives but it slows way down when they're really old. For example, one snake I had that was very old was only shedding once every year & a half.