Why are these two definitions for symmetries in the Lagrangian equivalent? I have heard the following two definitions for a symmetry of the Lagrangian:


*

*If under a coordinate transformation the form of the Lagrangian
remains unchanged then there is a symmetry.

*If $\delta \mathcal{L}=\partial_\mu F^\mu$, where $\mathcal{L}$ is the Lagrangian density, then there is a symmetry.
Are these two definitions equivalent? If so, how does the second imply the first?
 A: I) We interpret OP's question (v2) as essentially asking about the following.

What happens
L1) if the Lagrangian density $\delta {\cal L}= 0$ does not transform?
L2) if the Lagrangian density $\delta {\cal L}=\varepsilon~ d_{\mu} f^{\mu}$ transforms with a total space-time divergence?
Here $\delta$ denotes an infinitesimal transformation
$$\tag{A} \delta\phi^{\alpha}~=~\varepsilon~ (\ldots), \qquad \delta x^{\mu}~=~\varepsilon~ (\ldots),$$
of the fields $\phi^{\alpha}$ and spacetime coordinates $x^{\mu}$.
Moreover, $\varepsilon$ is an infinitesimal parameter, and the ellipsis $\ldots$ is shorthand for whatever transformation, we consider.

First of all, note that terminology differs from author to author. Some authors (see e.g. Ref. 1 and this Phys.SE post) call the transformation $\delta$ for a symmetry and a quasi-symmetry of the Lagrangian density ${\cal L}$ in the case L1 and L2, respectively. Other authors (see e.g. Ref. 2) speak of a strict symmetry and a symmetry,  respectively. While other authors simply call $\delta$ for a symmetry in both cases.
The two cases L1 and L2 are not equivalent, but Noether's theorem holds in both cases: There exists in both cases a local conservation law of the form
$$\tag{B} d_{\mu}J^{\mu}~\approx~ 0.$$
[Here the $\approx$ symbol means equality modulo eom.] However in case L2, the bare Noether current (i.e. the standard formula mentioned on Wikipedia) needs to be improved with (minus) $f^{\mu}$ in order to obtain the correct full Noether current $J^{\mu}$ in eq. (B).
II) Finally, as innisfree points out, instead of the Lagrangian density ${\cal L}$, one can also consider the action
$$\tag{C} S~=~\int_{R}d^4x~ {\cal L},$$
where $R$ denotes a spacetime region. Often (but not always) the region $R$ is assumed to transform in accordance with the horizontal transformation $\delta x^{\mu}$.
There are again two cases:

S1) The action $\delta S =0$ does not transform.
S2) The action $\delta S =\varepsilon \int_{\partial R} d^{3}x~f $ transforms with a boundary term.

In analogy with Section I, the transformation $\delta$ is by definition called various author-dependent variations of the phrase symmetry of the action $S$ in the two cases S1 and S2. Noether's theorem holds again in both cases.
Note however that the cases L1 and L2 do not necessarily map to the cases S1 and S2, respectively. For instance, it could happen that a quasi-symmetry (L2) of the Lagrangian density $\cal L$ for certain choices of region $R$ turns into a strict symmetry (S1) of the action $S$. For an example of this phenomenon, see e.g. my Phys.SE answer here.
References:

*

*J.V. Jose and E.J. Saletan, Classical Dynamics: A Contemporary Approach, p. 565.


*P.J. Olver, Applications of Lie Groups to Differential Equations, 1993.
A: The definitions are equivalent because the action is invariant in each case, that is, $\delta S = 0$.
Let us take case 2, in which $\delta \mathcal{L} = \partial^\mu F_\mu$. By Stokes' theorem, the total divergence results in a surface integral at infinity,
$$
\delta S = \int d^4x\delta\mathcal{L} = \int  d^4 x \partial^\mu F_\mu= \int d\Sigma^\mu F_\mu = 0 \text{ if $F_\mu \to 0$ sufficiently rapidly at the boundary}.
$$
We assume that $F$ vanishes sufficiently rapidly, such that the integral, and thus the variation of the action, is zero. 
The Lagrangian can change by a divergence, because the action is unchanged. Remember that it is the action that appears in the path integral in QFT (and in the least action principle in CM!) rather than the Lagrangian. As long as the action is invariant, we have a symmetry. (Strictly speaking, the measure in the path integral must also be invariant - see anomalous symmetry breaking.)
