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 R M be a trivial extension of a ring R by an R-R-bimodule M such that M is a generalized compatible R-R-bimodule and Z(R) is a generalized compatible R M-R M-bimodule. We prove that (X,alpha) is a Gorenstein projective left R M-module if and only if the sequence M circle times RM circle times RX -> M circle times alpha M circle times RX ->alpha X is exact and coker(alpha) is a Gorenstein projective left R-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.