Chop with a sharp knife or snip with scissors
A sharp knife is imperative for chopping herbs. A dull one will crush and bruise tender leaves, giving you blackened rather than green results. I use scissors to snip off small amounts of tender herbs, especially chives, whose stringy fibers are difficult to cut cleanly with a knife.
The more tender the herb, the closer to cooking time you'll need to chop it. If you chop in advance, cover the herbs with plastic wrap punctured with a few air holes and refrigerate them. You can save leftover chopped herbs for a day or so, but sniff them before using, especially parsley, cilantro, basil, and dill, which are highly perishable when chopped.
Whether you add the herb whole or chopped, or at the start of cooking rather than at the end, depends on both the herb and the effect you want.
If you want the herb to contribute a rounded background flavor, add a sprig at the beginning of cooking. Strong, resinous herbs like marjoram, thyme, and savory do best when allowed to mellow during the cooking process. To gently release the flavor oils of an herb in a slow-cooking sauce, soup, or stew, lightly crush the sprig before adding it to the liquid. Leaving the leaves on the stem makes it easy to remove the whole herb later.
For a more forthright herb flavor, chop the herb and add it near the end of cooking. The pungent, unmistakable aroma of chopped cilantro seems to dissipate quickly, so I stir it in directly after cooking, which also helps it to retain its bright green color. Sometimes you'll want to emphasize an herb's flavor by adding it both before and after cooking. For my marinara sauce, I add whole sprigs of basil at the start, and then I liven up the basil flavor by adding finely shredded leaves just before taking the sauce off the heat.