Noob looking for help with subdivision surface modifier

So I just started learning Blender this week, and after watching some tutorials I thought I would start with trying to create a tea cup. When trying to use the subdivision surface modifier some very unwanted new faces are created.

Before modifier:

After modifier:

What have I done wrong and what should I do to get the smoothed effect that I’m looking for?

Thanks for reading and helping out this clueless beginner.

You haven’t supplied a wireframe view or a .blend file.

Some general notes
Remove any double vertices
If you don’t specifically know when it is ok to use ngons (faces > 4 sides) do not use them, use quads

ngons used inappropriately + subsurf modifier -> crap result

Yeah, looks like you used ngons on the top rim. As Richard said, quads is the way to go. It’s just better practice and you learn more imo if you try and stick to quads.