Absorbed light must having an energy that matches a possible electronic transition within the molecule. The direct photolysis by UV-254 nm light ,it means the molecule is strongly absorbs UV-light at 254 nm .I think the absorption of 254 nm light associates with existence of π bonds(π- π* transition) within the molecule.
Kishore is right, the direct photolysis also yield hydroxyl radical from photodissociation of H2O, though at lower rate, and could be another possible reason for direct photolytic degradation of compounds with absorption at 623nm, Some molecules absorb close to 254nm but still no direct photolysis, all these are explained in literature