What property of a wing allows it to flex?
The flexing of a structure like an aircraft's wing is generally due to the materials used, but is also related to the nature of the structure itself.

In very simplified form, a wing is a beam that is supported at one end (the fuselage). Any forces such as from aerodynamics that act on the beam will cause it to bend. 

All materials have a characteristic way in which they behave when load is applied. This can be expressed as stress (from applied forces) vs. strain (deformation of the material). Once the material reaches the yield strength point, it will be permanently deformed. For stress below this point, though, the material will return to its original shape. The wing can then flex as long as it remains below the yeild strength in all required loads.


See here for more about this graph

Of course there is much more detail to the subject. The whole structure is designed together so that it will be as light as possible, but the amount of flexing is limited to prevent related issues. The wing may need to be made more stiff to prevent flutter. Farhan mentions fatigue, which can also limit the amount the wing may flex. The panels on top and bottom of the wing must also be prevented from breaking or permanently buckling. There are also fuel tank seals that should not be broken. Adding material in the right places can help to spread out the loads, which reduces the stress on the material and therefore reduces the amount of flexing.