To
close a path, position the Pen tool over the first (hollow) anchor
point. A small circle appears next to the Pen tool pointer when
it is positioned correctly. Click or drag to close the path.
To leave a path open, Ctrl-click (Windows) or Command-click (Mac OS) anywhere away from all objects.
To leave the path open, you can also select a different tool, or choose Select > Deselect in Illustrator or Edit > Deselect All in InDesign.