A homomorphism of (not necessarily commutative nor unital) rings $u:R\to S$ is flat if the extension of scalars (= inverse image) functor $u^*:{}_R Mod\to {}_S Mod$, $M\mapsto S\otimes_R M$ 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 over its codomain, then for many purposes good families are flat (e.g. in deformation theory).
Flat modules: A right $R$-module $M_R$ is flat if the functor ${}_R N\mapsto M \otimes_R N$ from the category of left $R$-modules to the category Ab of abelian groups is exact.
A morphism $f:X\to Y$ of schemes is flat if the induced map on stalks is a flat morphism of (commutative unital) rings.
A morphism of schemes is faithfully flat if it is flat and epi.
A morphism of affine schemes $Spec(B) \to Spec(A)$, hence coming from a ring homomorphism $f \colon A \to B$
flat precisely if $f$ exhibits $B$ as a flat module over $A$;
faithfully flat if $f$ exhibits $B$ as a faithfully flat module over $A$.
A flat morphism $Spec(B) \to Spec(A)$ is faithfully flat if it is an epimorphism.
(e.g Milne, footnote 18)
Given a base scheme $S$, the slice category $Sch/S$ of relative schemes over $S$ is equipped with several flat Grothendieck 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 et quasicompact, ‘faithfully flat and quasicompact’) topologies. Cf. wikipedia:flat topology
The standard reference is EGA IV. See also flat morphism in derived geometry.
See also