At the moment you place the pre-order, not when the game unlocks. The purchase is processed immediately and the game simply sits in your library in a pre-loadable state until release.
That has one practical consequence worth knowing: refunds follow Steam's normal policy rather than starting fresh on launch day, so if you are unsure about a title, waiting for reviews costs you nothing.