Watch this short video 'Why do Supermarket Herbs Die' which will explain, or read the script - the video has captions, so you could do both :-)
Below, I'll tell you what you could to which *might* save the herbs.
There's not a great deal you can do other than remove them from the pot they've come in and set them separately in fresh new potting compost.
Keep them watered and remove any bits that are dying.
Put them somewhere they can have good light and out of draughts.
It's probable that they've already started to die and you might lose them whatever you do. There's so many variables, like how long they've been out of their growing houses and in the supermarket, were they in a draught, are they by the front doors of the store and getting blasted with cold air every minute.
It could very well be that they're on their last legs and the best thing you can do is use the bits you want for the purpose you bought it and then either freeze, dry or make pesto, oil, butter etc with the rest.
I hate things dying but if I've done my best to use it and not wasted any, then I don't feel so bad.
This thyme plant is one of the worst examples I've seen coming from a supermarket - I had it just one week and you can see the way it's rotted on one side - look at the grey fuzzy mold growing on the stems. I got it home and took the plastic off and could see it had already started to die back - I thought I'd let it happen so I could photograph it for you to see.
I'm quite good at looking after plants or so I thought - I couldn't save this one!
Let me first tell you how plants select for themselves and once you know that, it will all fall into place. Why do supermarket herbs die?
Plants adapt to their environment - they have to, because they don't have legs and can't move, so they have to make the best of where they land or they'll die.
You'll have seen examples - maybe in your lawn, where part of it is in shade and grows poorly and the narrow bladed grass dies no matter that it's the same seed as in the rest of the garden - it's the environment.
Plants don't grow in environments that are hostile to their requirements - it's why you can't grow bananas in your garden unless you live in a tropical climate.
Plants grow leaves according to the conditions they find themselves in - bigger leaves means more surface area, means more sunlight, means more food (via photosynthesis, which is the process by which plants get their energy) - so if a plant finds itself in a shady spot, it grows relatively bigger leaves.
The supermarket herbs are grown under artificial conditions - perfect for plants, 18 hours of light and 6 hours of dark. Their leaves are small by comparison to plants grown naturally, as they're getting all the energy they need. That's why they grow so big in about three weeks - you're basically buying a pot of seedlings.
Move them out of these perfect conditions into the supermarket and the death sentence begins. They're in shock by being in the supermarket, away from their growing houses - their growth pattern begins to change, because it has to. Most of this is hidden by the clever plastic wrapper which holds the plant upright and shows its lush leaves.
The plants respond to this change, by growing their stems quicker to reach the light, at the same time, they'll be trying to grow bigger leaves to compensate for the lack of 'good' light. They shed their smaller leaves to give themselves more energy to put into growing bigger leaves. They get very tall (extra stem) and the quick growth spurt has only put on weak stems which keel over. Do you recognise the pattern?
A plant that you sow from seed has the best chance. It's been brought up in 'your' environment - next best chance is a plant that you buy from a nursery or plant grower.
The very least likely to survive beyond two weeks is the supermarket herbs. They're not designed to last longer - the soil is weak seedling compost and designed to feed for around six weeks only. Any stronger and it might 'burn' the seedlings.