We present a gated silicon single-photon detector based on a commercially available avalanche photodiode. Our detector achieves a photon-detection efficiency of 45±5% at 808 nm with 2·10(-6) dark count per nanosecond at 30 V of excess bias and -30°C. We compare gated and free-running detectors and show that this mode of operation has significant advantages in two representative experimental scenarios: detecting a single photon either hidden in faint continuous light or after a strong pulse. We also explore, at different temperatures and incident light intensities, the "charge persistence" effect, whereby a detector clicks some time after having been illuminated.