How far in advance can I prepare vegetables without it detracting from their flavour/ texture etc?
The easy answer is that almost all things will start to deteriorate at soon as cut, but noticeable is the key.  John points out, this will vary by item.  Most fruits and softer items will be far less forgiving.  Potatoes, a relatively hard item tends to oxidize badly, but water dunking tends to fix that with them as well.  Items as you mention though, carrots, celery, lettuce, cabbage, any item that is pickled, these type of items tend to be more forgiving.  An hour, maybe two, you likely will not notice any loss of quality.  Plastic wrap to prevent drying will help and maybe extend this time.  Wrapping and then ice or refrigerate, even better for dry items, but for wet items like cucumbers the weeping can be detrimental.  With things like onions, garlic and herbs, well I would classify these as aromatics and part of their flavor is being lost anytime you can smell them so I would tend to save them for prep closer to use if possible.  If you do need to prep them ahead, I have minced garlic a hour ahead for instance, then tossed it with olive oil that I was going to use in the dish.  Please do this short term only though, as raw garlic stored is olive oil is classified by USDA as a salmonella risk.  Hour should be fine, days not so much.