Preheat your 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, then add 16 oz gnocchi straight from the package, separating any pieces that are stuck together.
Season with salt and black pepper to taste, then cook the gnocchi in the sauce, stirring occasionally, until the gnocchi are soft and cooked through, about 5 to 6 minutes.
Place 8 oz sliced fresh mozzarella evenly over the gnocchi.
Transfer the skillet under the preheated broiler and broil until the cheese melts and bubbles, about 2 to 3 minutes—watch closely to avoid burning.
Remove from the oven, garnish with 1/3 cup chopped basil if using, and serve immediately.