Wash and pierce the potatoes with a fork. Boil them until tender, about 20-30 minutes. Let them cool slightly.
Peel the potatoes while still warm and pass them through a potato ricer onto a clean surface to mash.
Sprinkle salt and pepper over the mashed potatoes. Spread 1 1/2 cups of the flour over the potatoes and add the beaten egg. Gently mix to form a dough. If the dough is too sticky to work with, add the remaining flour.
Knead the dough lightly on a floured surface until it is smooth and soft, about 1-2 minutes.
Divide the dough into 8 parts. Roll each part into a long rope, then cut into 1-inch pieces. Optionally, press each piece against the tines of a fork to make ridges.
Bring a large pot of salted water to a boil. Cook gnocchi in batches until they float to the top, about 1-2 minutes. Drain.