The exact guidelines differ from place to place and depend on how the local recycling process is setup.
Where I live for example, it's ok to leave metal caps on glass bottles because all metals are automatically filtered out, whereas in other countries people are asked to remove the caps.
The same goes for plastic, some places recycle only specific plastic types and all plastics should be clean, and others collect all plastics and it isn't a problem if there are stains.
Generally speaking, it's best to separate the different types of material as much as possible (if they belong to different bins).
For plastics it's best to leave as little food leftovers or other materials as possible because the more leftovers there are, the more the plastic quality goes down when it is recycled.
Also biodegradable plastics are better not collected with regular plastics.
Bio-waste is generally everything that is organic and can be composted; food leftovers, grass clippings, egg shells, cardboard, paper handkerchiefs.
These are general guidelines.
Your local recycling facility may have slightly different guidelines
so it's best to check with them.
sustainability.stackexchange.com/users/99/THelper
The most important reason for cleaning your recycles is for your own comfort and safety before they are picked up by the recycler.
If you have a small blue bin in your kitchen, and you toss a sticky jammy jam jar into it and leave it there for a week or more, you may end up with ants or other insects or vermin attracted by the jam.
So you give it a quick rinse before you put it in there.
If you take individual items outside and put them in a communal bin, there is still the matter of wasps, ants, rats and whatnot getting very interested in whatever food scraps you have left in your recycles.
I rinse cans and jars under the tap.
Plastic and foil that are too sticky and messy to clean, I put into the garbage.
I don't take labels off anything (our instructions from the municipality say we don't need to.)
I do take things apart a little: for example a tissue box is cardboard with a little plastic where the actual tissues come out, and I take that plastic off and put it in the bag I use to collect film plastic, then put the cardboard in the box for cardboard.
Basically, if you make it clean enough that you don't mind it hanging around inside your home, or very near the door to your home, for two weeks, then it will likely be clean enough for your recycler.
sustainability.stackexchange.com/users/1053/Kate Gregory
Further to @THelper's answer, it's also worth considering that (in many recycling plants) most materials put out for recycling are handled at least to a small degree by real people, even if they just go past on a conveyor belt.
As a gesture of respect, it's nice to avoid anything that smells completely rotten.
It's not a job I would want to do, so I like to think I can at least make the job more pleasant for those that do it.
sustainability.stackexchange.com/users/15/Highly Irregular
In terms of the impact on the waste stream, don't get in a swivit about it.
Example:
Our dump takes ALL plastic pails, and they go through a shredder.
Then a magnetic separator to remove shredded metal handles, Then they go through a series of washing cycles, with hot soapy water and various solvents.
This removes most food items.
The solvents remove left over oil and grease.
Then they are packed in to 4 foot cube nylon bags and sold as feed stock to other uses.
sustainability.stackexchange.com/users/400/Sherwood Botsford
Its more a question of basic hygiene I think.
Do you want rats / wild animals rummaging in your recycling bins for leftover bits of food?
Would you want, as a recycling operative, to pick up a box of clean glass jars, or jars with bits of Dolmio, brine or Mayo left in.
Its common decency
I think to keep things clean, but here in the UK there is no steadfast law that says things should be cleaned out.
Its simply manners.
sustainability.stackexchange.com/users/1713/Simon
Outside my apartment, there are 3 rubbish bins. One for  glass , another for  metals, paper and plastics  and a third without a label, for bio-waste I guess.  So I wonder what are some guidelines for when a package goes to number 2 or 3? If there is still chocolate on the inside of my waffle package, where does it go? What about a plastic box or glass jar of mayonnaise? What about a plastic widget with some rubber on it? What about wet paper, handkerchiefs?
How 'clean' should something be for recycling?
sustainability.stackexchange.com
<recycling>
sustainability.stackexchange.com/questions/3025
sustainability.stackexchange.com/users/108/Vorac
The guidelines differ from place to place and depend on how the local recycling process is set up. Generally speaking, it's best to separate different types of material as much as possible. As a matter of basic hygiene, if you make it clean enough that you don't mind it being inside or near the door to your home for two weeks, then it will likely be clean enough for your recycler. Whilst guidelines can vary locally, separating materials by type and keeping things reasonably clean can be kept in mind.
Guidelines vary locally, separating materials as much as possible is a good principle. This is a basic hygiene issue, materials should be clean enough to be kept in your home for two weeks.