Their distance allows it (it's less than half an hour by car, a little more by public transport) but visiting Pompeii is worth spending the entire day. I would recommend staying in Naples two or three days, but if you're in a hurry you should at least visit Naples, spend the night there and visit Pompeii the day after.