A density wave (DW) is a fundamental type of long-range order in quantum matter tied to self-organization into a crystalline structure. The interplay of DW order with superfluidity can lead to complex scenarios that pose a great challenge to theoretical analysis. In the past decades, tunable quantum Fermi gases have served as model systems for exploring the physics of strongly interacting fermions, including most notably magnetic ordering1, pairing and superfluidity2, and the crossover from a Bardeen–Cooper–Schrieffer superfluid to a Bose–Einstein condensate3. Here, we realize a Fermi gas featuring both strong, tunable contact interactions and photon-mediated, spatially structured long-range interactions in a transversely driven high-finesse optical cavity. Above a critical long-range interaction strength, DW order is stabilized in the system, which we identify via its superradiant light-scattering properties. We quantitatively measure the variation of the onset of DW order as the contact interaction is varied across the Bardeen–Cooper–Schrieffer superfluid and Bose–Einstein condensate crossover, in qualitative agreement with a mean-field theory. The atomic DW susceptibility varies over an order of magnitude upon tuning the strength and the sign of the long-range interactions below the self-ordering threshold, demonstrating independent and simultaneous control over the contact and long-range interactions. Therefore, our experimental setup provides a fully tunable and microscopically controllable platform for the experimental study of the interplay of superfluidity and DW order.