Is it necessary to first remove the stems from fresh cilantro when chopping it for a recipe? If so, how much of the stem should be removed?
The stems are edible and flavorful, with a crunch that may or may not be desirable in your dish, but the lower portion of them tends to be a little stringy. I always trim off the bottom, but as for the rest of the stem, it depends on what I am making.
For raw dishes where it is chopped quite finely (koshimbir, pico de gallo) or even ground to a paste (chutney), or if there are other crunchy textured ingredients, I will chop and include the stem (the middle to upper part, where there are also leaves branching off, or as much of it seems tender).
If I am cooking it (as a seasoning in a soup or dal) or if it will be wilted and steamed as it is tossed with a hot dish, then it is also fine to include it (chopped).
For other things (raw, where a crunch will be out of place), I only use the very tender parts of the stem with the leaves. Or if the leaves will be more visible as a garnish or accent, I might strip the leaves from the stems more carefully and not use any (or much) stem.
This is generally how I treat most herbs that don't have a woody stem, at least, if the stem has a nice flavor like the leaves.
For most herbs, if the stems are tender, it is fine to just chop and add. Of course it depends on the application. For example, as a garnish, sometimes stems with leaves work, sometimes not. Then, there is also the SE Asian tradition of using stems and roots of cilantro in marinades and rubs (no leaves). My own metric, for almost any herb, is if the stem is so dense that it will be noticed as "stem", I don't use it. Otherwise, it gets chopped and added.
I pick the prettiest leaves off the stem to use (chopped as necessary) as garnish. Without getting nuts about removing all of the stem (or I do get nuts about it, depending on the dish), I chop up more leaves to use in the dish. What I'm left with is a few leaves and lots of stems. I chop off the root end of the stem (where the stem becomes paler), and then I throw the bright green stems and remaining leaves into the food processor and whir with a little bit of oil and vinegar. That's a no-waste cilantro dressing that I can use if the dish needs more cilantro flavor, or save in the fridge for weeks for a bit of cilantro when I want it later.
It is not necessary to remove the leaves from the stem, it's a matter of aesthetics. The stems are a bit woodier, big pieces can negatively affect the texture of the dish. However, the stems are full of flavor. What is wasteful of effort or cilantro (and many other herbs) is a bit subjective. I find the method above a pretty good balance of conservation of the ingredient and effort, and overall fussiness.
When cooking I would always chop the stems to include them as seasoning while frying/cooking and leave the leafs for using them either freshly in the end over the dish or mix them into the dish right (a minute or so) before you serve it. This way you will still get flavor out of the stems (in a different way), and also they soften up and look great.