How to determine where bit will start plunging and where it will retract?

For a keyhole we have a specific toolpath:

Where a toolpath begins/ends is determined by the program, except for contour toolpaths associated with unjoined/open geometry — they will begin/end at the begin/end points.

You can verify where those points will be in the 3D preview: