Protection from UV (but only those wavelengths that the photochromic material does not require for photoactivation) as well as exclusion of oxygen and moisture all help.
Commercial photochromic dyes are also sensitive to acidity, so photochromism at extremes of pH will be short-lived.
As far as photochromic substances in polymeric matrices are concerned, typically one can use commercially available UV absorbents to mop up photons of unwanted wavelengths and industrial additives like HALS and antioxidants to remove destructive radicals in order to increase the longevity of the photochromic effect.
The Tinuvin range of light stabilizers contain useful UV absorbents and HALS for protecting photochromic organic materials. The effectiveness of a particular combination of additives may vary with photochromic substance and its environment, but the right mixture can increase durability by an order of magnitude or more.
Other strategies include mass coloration of polymers rather than using coatings, so that photochromic colorant remains available to generate an effect even when that in the outermost layer has been destroyed.
Lamination transparent at UVGI wavelengths to provide a protective layer for exclusion of oxygen and moisture as well as filtering out unwanted UV wavelengths is also a useful tactic.
Commercial photochromic organic materials are all susceptible to permanent photochemical change so minimizing UV exposure during the lifetime of the photochromic object is also worthwhile when feasible.