Is it necessary to sort beans after roasting? After roasting, the beans colour is usually uneven. Most of the beans have the desired roast, but some are burnt, and some have visibly lighter colours.

Some people sort every single bean after every roast. It is impressive work and result, but also tedious. I believe that is necessary for the look of the beans in a retail shop. Some other people sort just a little to remove really bad beans (i.e. burnt).

What are criteria / conditions to sort beans?

I wonder about taste: A tiny number of beans with different roast should not impact it, but I lack experience to know.
It will affect the flavor. Whether that's particularly noticeable depends on the bean, the roast you're going for, and how much variance there is in the roast. Whether it matters to you is a personal decision. 

In my experience, over-roasted beans are worth removing from a light roast (I tend to prefer city roast at darkest), even if they're not actually burnt - the flavor of even a few dark beans will tend to overwhelm the more delicate flavors of a lighter roast. 

That said, I use a popcorn popper; there tends to be a lot of variation in the results. If you have a better roasting setup, you can probably avoid a lot of the hassle.