"Optional stopping" and "optional sampling" refer to a strategy of peeking while you are sampling and then, based on what you find, exercise the option to quit sampling.
Doob's theorem states that in a fair casino, where your return is a martingale, you cannot increase your expected return if you are given the option to stop betting (= sampling) when you think "it's time to quit".
The names originate from J. L. Doob, Stochastic Processes (Wiley, 1953): page 300, 366. Doob uses "optional sampling" for the stochastic process itself, and "optional stopping" for the random variable that represents the stopping time.