We introduce the concepts of generalized compatible and cocompatible bimodules in order to characterize Gorenstein projective, injective and flat modules over trivial ring extensions. Let [Formula: see text] be a trivial extension of a ring [Formula: see text] by an [Formula: see text]-[Formula: see text]-bimodule [Formula: see text] such that [Formula: see text] is a generalized compatible [Formula: see text]-[Formula: see text]-bimodule and [Formula: see text] is a generalized compatible [Formula: see text]-[Formula: see text]-bimodule. We prove that [Formula: see text] is a Gorenstein projective left [Formula: see text]-module if and only if the sequence [Formula: see text] is exact and coker([Formula: see text]) is a Gorenstein projective left [Formula: see text]-module. Analogously, we explicitly characterize Gorenstein injective and flat modules over trivial ring extensions. As an application, we describe Gorenstein projective, injective and flat modules over Morita context rings with zero bimodule homomorphisms.