To quote from p. 6 of the amsmath user guide (note that
gather is an environment provided by the
amsmath package is in use page breaks between equation
lines are normally disallowed; the philosophy is that page breaks in such
material should receive individual attention from the author. To get an individual
page break inside a particular displayed equation, a
command is provided.
\displaybreak is best placed immediately before the
\\ where it is to take effect. Like LATEX’s
an optional argument between
4 denoting the desirability of the pagebreak.
\displaybreak means "it is permissible to break here" without encouraging
\displaybreak with no optional argument is the same as
\displaybreak and forces a break.
If you prefer a strategy of letting page breaks fall where they may, even in the
middle of a multi-line equation, then you might put
in the preamble of your document. An optional argument
1–4 can be used for
 means allow page breaks, but avoid them as much as possible;
4 mean increasing permissiveness. When display breaks are
\\* command can be used to prohibit
a pagebreak after a given line, as usual.