Given that plants do not have pain receptors, nerves, or a brain, they do not feel pain as we members of the animal kingdom understand it. Uprooting a carrot or trimming a hedge is not a form of botanical torture, and you can bite into that apple without worry. However, it seems that many plants can perceive and communicate physical stimuli and damage in ways that are more sophisticated than previously thought.
Some plants have obvious sensory abilities, such as the Venus flytrap and its incredible traps that can close in about half a second. Similarly, the sensitive plant rapidly collapses its leaves in response to touch, an adaptation that might serve to startle away potential herbivores.
While these plants visibly display a clear sensory capacity, recent research has shown that other plants are able to perceive and respond to mechanical stimuli at a cellular level. Arabidopsis (a mustard plant commonly used in scientific studies) sends out electrical signals from leaf to leaf when it is being eaten by caterpillars or aphids, signals to ramp up its chemical defences against herbivory.
While this remarkable response is initiated by physical damage, the electrical warning signal is not equivalent to a pain signal, and we should not anthropomorphize an injured plant as a plant in pain. Plants have exceptional abilities to respond to sunlight, gravity, wind, and even tiny insect bites, but (thankfully) their evolutionary successes and failures have not been shaped by suffering, just simple life and death.