A homomorphism of (not necessarily commutative nor unital) rings is flat if the extension of scalars (= inverse image) functor , is an exact additive functor. Recall that every extension of scalars functor for modules is cocontinuous and a fortiori admits a right adjoint. Hence this definition is in an agreement with the more general notion of a flat functor in category and topos theory.
If one pictures a morphism as a family, then for many purposes good families are flat (e.g. in deformation theory).
Flat modules: A right -module is flat if the functor from the category of left -modules to the category Ab of abelian groups is exact.
A morphism of schemes is flat if the induced map on stalks is a flat morphism of (commutative unital) rings. Given a base scheme , the slice category of relative schemes over is equipped with several flat topologies. These are the Grothendieck topologies in which covers consist of flat morphisms which set-theoretically cover the target scheme with some additional finiteness conditions. The usual choices are the fppf? (fr. fidèlement plat de presentation finie, ‘faithfully flat and of finite presentation’) and fpqc (fr. fidèlement plat e quasicompacte, ‘faithfully flat and quasicompact’) topologies. Cf. wikipedia:flat topology
The standard reference is EGA IV. See also flat morphism in derived geometry.