The abundance and properties of planets orbiting binary stars -circumbinary planets -are largely unknown because they are difficult to detect with currently available techniques. Results from the Kepler satellite and other studies indicate a minimum occurrence rate of circumbinary giant planets of ∼10 %, yet only a handful are presently known. Here, we study the potential of ESA's Gaia mission to discover and characterise extrasolar planets orbiting nearby binary stars by detecting the binary's periodic astrometric motion caused by the orbiting planet. We expect that Gaia will discover hundreds of giant planets around binaries with FGK dwarf primaries within 200 pc of the Sun, if we assume that the giant planet mass distribution and abundance are similar around binaries and single stars. If on the other hand all circumbinary gas giants have masses lower than two Jupiter masses, we expect only four detections. Gaia is critically sensitive to the properties of giant circumbinary planets and will therefore make the detailed study of their population possible. Gaia's precision is such that the distribution in mutual inclination between the binary and planetary orbital planes will be obtained. It also possesses the capacity to establish the frequency of planets across the H-R diagram, both as a function of mass and of stellar evolutionary state from pre-main sequence to stellar remnants. Gaia's discoveries can reveal whether a second epoch of planetary formation occurs after the red-giant phase.