For very small output voltages, the diodes are off. So gain is determined by R5 and R6 only. For high (positive or negative) output voltages, the diodes are forward biased. As a first approximation, they can be viewed as short-circuit in this case, so gain is determined by (R5 in parallel with R7) and R6.
The exact behaviour of such a circuit is complex, and most easily analyzed using a circuit simulator. Also google "picewise linear amplifier".
Samuel