Bring a large pot of salted water to a boil. Add the gnocchi and cook until they float, about 2 minutes; reserve 1/4 cup of the pasta water, then drain the gnocchi.
In a large skillet over medium heat, melt 1 to 2 tablespoons butter. Add the drained gnocchi and cook, stirring occasionally, until lightly golden, 3–5 minutes.
Reduce heat to low and add 1/3 cup pesto and 1/2 cup heavy cream to the skillet. Stir to combine and bring to a gentle simmer.
Simmer until the sauce thickens slightly, about 1 minute; if the sauce is too thick, add 1–2 tablespoons of the reserved pasta water to loosen it.
Season with salt and pepper to taste, toss to coat, and serve immediately.