Wait till the tops die down, then lift. Aim for a dry spell, so that you can leave them for a couple of hours to dry off before you store them. If you planted them in May, they probably won't be ready yet. (My mains go in early April, and the tops haven't died back yet.) But try to lift them by the end of September.
Then go through and store the unblemished ones - paper sacks are good, and in a dry, dark, frost-proof shed or garage. (We have a small cellar under the back of the house.)
Use the damaged ones first. (It's a favourite gardening trick to put a fork through the biggest & otherwise unblemished one!!) I've had no real problems with storing scabby potatoes, but perhaps others will say differently.