It depends what you're making. For some things it's perfectly fine, and for others it's worth grating your own.
What's different: bagged shredded cheese is usually tossed with anti-caking agents, such as powdered cellulose or starches, so the shreds don't clump in the bag. Some also add natamycin, a mold inhibitor. Cooks widely report that these coatings keep the shreds from melting together smoothly, and can leave a slightly powdery feel in sauces.
- Pre-shredded is fine for: nachos, tacos, casseroles, baked potatoes, and anything where the cheese melts on top of other food.
- Grate your own for: cheese sauce, queso, mac and cheese, grilled cheese, fondue, and anything where the cheese needs to melt into something smooth.
Tips: a block of cheese grates more easily when it's cold, and a box grater only takes a minute. Grating your own often costs less per ounce, too.
Related: What cheese is best for fondue? Can you make it without wine? · Why does melted cheese turn greasy or stringy? · What is processed cheese?