Flexibility is the ability to be conscious about our current moods, emotions, and desires and behaving based on long-term values and goals rather than short term desire or impulsivity. Research by Kashdan & Rotterburg has broken down the process in which flexibility works.
Flexibility is the ability to adapt to a changing situation, "reconfigure" mental resources, change perspective, and ultimately balance needs, wants, and life demands. Let's say a person is at a work party and someone they despise shows up even though they were not supposed to. A person with high flexibility would adapt to the situation, take their anger and other negative emotions and reconfigure them, realizing that their emotions were not important enough to cause a scene and ruin the party. So you balance your needs and wants and discreetly leave the party at a good time.
Flexibility is essentially how a person interacts with their environment. People with low flexibility may have anxiety, depression, difficulty in work and learning situations, and substance abuse issues.