Well, the answer depends on your interests and travel style. If you're interested in exploring Naples' historic sites such as Pompeii and Herculaneum or enjoying the stunning views of the Bay of Naples from Mount Vesuvius then two to three days are recommended.
However, if you want to immerse yourself in Naples' culture by trying out their traditional foods like pizza or seafood dishes or enjoy taking a day trip to the stunning island of Capri or exploring the picturesque towns along the Amalfi Coast, such as Positano and Amalfi, then 4 to 5 days would be more suitable.