Preheat your oven broiler and have an oven mitt ready.
Heat 1 tablespoon olive oil in a large oven-safe skillet over medium-high heat.
Add 2 cloves minced garlic and cook, stirring, for about 2 minutes until fragrant but not browned.
Pour the 25.25 oz jar of marinara sauce into the skillet and stir to combine with the garlic.
Add 16 oz gnocchi straight from the package, breaking apart any pieces that are stuck together; do not pre-cook the gnocchi.
Season with salt and black pepper to taste, then cook the gnocchi in the sauce, stirring occasionally, until the gnocchi are tender and cooked through, about 5 to 6 minutes.
Arrange the 8 oz sliced fresh mozzarella evenly over the top of the gnocchi and sauce.
Place the skillet under the preheated broiler until the mozzarella melts and bubbles, about 2 to 3 minutes—watch closely to avoid burning.
Remove the skillet from the oven, sprinkle with 1/3 cup chopped basil if using, and serve immediately.