Why charge is Lorentz invariant but relativistic mass is not? I have been reading Purcell's electromagnetism. In the text, he talks about conservation of mass, and charge; and invariance of mass, and charge. He says that charge is invariant because results of experiments support it. Mass is not invariant because when a matter moves with constant velocity relative to a stationary observer, it gains some mass (actualy energy).
However, I cannot fully understand invariance of charges. What is the deep meaning of this? It is invariance because of our definition of charge?
When we apply Gauss' Law both mass and charge should be same relative to every refference system (I think).
Can we explain this phenomenon without experiments' result, can we connect this to a fundamental physics?
 A: Taking your questions slightly out of order:

[Charge] is invariant because of our definition of charge? Can we explain this phenomenon without experiments' result?

That depends on your exact definition of "charge". For me personally, under the most natural conceptualization of "charge" the answer to both questions is no, and charge Lorentz-invariance is a purely empirical result. Other physicists might answer differently.

What is the deep meaning of this? Can we connect this to a fundamental physics?

Yes. A remarkable fact of physics is that the non-relativistic Coulomb's law and Newton's law of universal gravitation are virtually mathematically identical (the only real difference is that electric charge can have either sign but we usually only consider positive masses), but their relativistic generalizations are very different (classical electromagnetism and general relativity, respectively). This means that there are two different fully consistent ways to generalize the non-relativistic law into a relativistic one. Basically, the only difference is whether you choose the "charge" to be relativistically invariant or not.
Empirically, the charge of a point particle is a Lorentz scalar, meaning it's relativistically invariant and the same in every Lorentz frame. For a charged continuum fluid, the charge density $\rho$ is the $0$-component of a relativistic four-vector $J^\mu := (\rho, {\bf J})$. Very roughly speaking, the number of Lorentz indices (one, in this case) tells you how many factors of the Lorentz factor $\gamma$ you acquire under Lorentz boosts. Electric charge density has the schematic form (charge / volume) = (charge / (length in boosted direction) $\times$ (cross-sectional area tranverse to boosted direction)). The "charge" and "tranverse area" parts don't change under a Lorentz boost, but the "1/(length in boosted direction)" part does and acquires a factor of $\gamma$ due to length contraction, so there is one factor of $\gamma$ overall.
But a point particle's "relativistic mass" (better thought of as its total energy, rest mass + kinetic energy), is the $0$-component of a relativistic four-momentum $p^\mu := (E, {\bf p})$, so it picks up one factor of $\gamma$ under Lorentz boosts. For a continuum fluid, which in GR is a more natural concept than point particles, we have that the "mass/energy density" transforms as the $00$ component of a stress-energy tensor $T^{\mu \nu}$ with two Lorentz indices. That's because the energy density has the schematic form (energy / volume) = (energy / (length in boosted direction) $\times$ (cross-sectional area tranverse to boosted direction)), and both the energy or "relativistic mass" and the 1/(length in boosted direction) pick up a factor of $\gamma$ under Lorentz boosts, so there are two factors of $\gamma$ in total.
So there are two different ways to generalize the mathematical form of Coulomb's law to make it relativistic. If you choose to do so in a way such that the charge is Lorentz invariant, you naturally get classical elecromagnetism. If you choose to do so in way such that the "charge" acquires a factor of $\gamma$ under Lorentz boosts, you naturally get general relativity. Remarkably, both choices come up in nature.
A: 
However, I cannot fully understand invariance of charges. What is the deep meaning of this? It is invariance because of our definition of charge?

Electric charge is quantified via its force effects.
Before relativity, every force was believed to have the same value in all inertial frames. Assuming this, let us consider two charged bodies with charges $q_1$,$q_2$. Both are at rest separated by a distance $r_{21}=|\mathbf r_2-\mathbf r_1|$, and $\mathbf r_{21} = \mathbf r_2-\mathbf r_1$. The Coulomb law states that force due the charge $q_1$ on the charge $q_2$ is
$$
\mathbf F_{21} = K\frac{q_1q_2}{r_{21}}\hat{\mathbf r}_{21}.
$$
Distance $r_{21}$ and vector $\mathbf r_{21}$ are the same in all frames,  value of the force $\mathbf F_{21}$ is the same in all frames (due to 2nd law), so the only possibility is that also $q_1q_2$ is the same in all frames. Considering this has to be true for any pair of charges in a system where many charges are present, the only possibility is that every charge $q_k$ has frame-independent value. So, we have a good argument for why charge is frame independent in pre-relativistic theory.
In relativistic theory, the above argument does not work, because the Coulomb formula is not valid in all frames. So new argument must be found. Relativistic formulae for electric force between two charges in motion are more complicated than the Coulomb formula above and inferring charge invariance using the same method may be difficult. Fortunately, there is another way.
One argument that seems to work is based on the local conservation of electric charge. In addition to force effect, electric charge also has the important property that it does not appear or disappear suddenly, but any change of net charge in a region of space is due to its continuous transport across the region boundary. The local conservation of charge is implied by the Maxwell equations and no violation was ever observed and confirmed. But if charge of a body decreased or increased without any transport of charge in or out of the body, net charge in a suitably chosen space region would be violating the conservation law whenever it accelerates or decelerates.
A more formal derivation:
Let $\rho$ be density of electric charge of a charged body, $\mathbf j$ electric current density and $V$ volume of fixed region in space whose boundary is $\Sigma$; let the densities be continuous across the boundary.
The law of local conservation of charge states that any change of charge inside the volume $V$ is due to electric current on the boundary of the region:
$$
\frac{d}{dt} \int_V \rho \,dV = -\oint_\Sigma d\boldsymbol{\Sigma} \cdot \mathbf j .
$$
Let us use such a region that $\mathbf j$ vanishes on its boundary. Then we have
$$
\frac{d}{dt} \int_V \rho \,dV = 0.
$$
This equation by itself does not mean that net charge in that region is the same in all inertial frames. However, it means that whatever the charges do (they may speed up or slow down), total charge in the region remains the same. If there is just one charged body and it accelerates due to external force, the above equation implies that total charge in the region does not change. In other words, speed of the charged object has no effect on its total charge.
With that knowledge, it is natural to use the same value of charge of the object in all inertial frames.
For relativistic mass of a region (net energy inside divided by $c^2$), it seems like the same argument could be used to conclude that relativistic mass of a body is the same independently of its speed, but that is a false conclusion. So the argument does not work in that case. Why not? 
Although the equation of local conservation of energy is the same as for conservation of charge:
$$
\frac{d}{dt} \int_V \rho_E \,dV = -\oint_\Sigma d\boldsymbol{\Sigma} \cdot \mathbf j_E
$$
and although we can have the body accelerate while $\mathbf{j}_E$ vanishes on the boundary, so
$$
\frac{d}{dt} \int_V \rho_E \,dV = 0,
$$
we cannot conclude from this that energy of the body inside does not depend on its speed. The reason is that some acceleration device is necessary inside the region to get the body accelerate without energy exchange with the outside; and this will contribute to total energy. Total energy does not depend on the speed of the body, but the body may exchange energy with the acceleration system and its energy will thus vary.
This problem did not arise with charge, because it is possible to accelerate the charged body without any other charge being present inside the boundary and without any exchange of charge through the boundary - just use external field.
A: 
Let the following 4 hypotheses about the electromagnetic field in empty space : 
$\:\color{blue}{\mathbf{A}}.\:\:$ Invariance of charge.
$\:\color{blue}{\mathbf{B}}.\:\:$ Covariance (invariance of form) of Maxwell equations.
$\:\color{blue}{\mathbf{C}}.\:\:$ Covariance (invariance of form) of Lorentz force equation.
$\:\color{blue}{\mathbf{D}}.\:\:$ The charge 4-current density is a Lorentz 4-vector.
Then 


*

*Assuming Charge Invariance ($\color{blue}{\mathbf{A}}$) and Lorentz Force Covariance ($\color{blue}{\mathbf{C}}$) it could be proved the Covariance of Maxwell equations ($\color{blue}{\mathbf{B}}$).

*Assuming Charge Invariance ($\color{blue}{\mathbf{A}}$) it could be proved that the 4-current density is a  Lorentz 4-vector ($\color{blue}{\mathbf{D}}$) and inversly

*Assuming that the 4-current density is a  Lorentz 4-vector ($\color{blue}{\mathbf{D}}$)  it could be proved the Charge Invariance ($\color{blue}{\mathbf{A}}$).

*Assuming Covariance of Maxwell equations ($\color{blue}{\mathbf{B}}$)  it could be proved that the 4-current density is a  Lorentz 4-vector ($\color{blue}{\mathbf{D}}$).


References :



*

*$\:\color{red}{\bf Classical\: Electrodynamics}$ [Jackson], 3rd Edition.


$\qquad$$\S$11.9 Invariance of Electric Charge;
Covariance of Electrodynamics

$\quad$The invariance in form of the equations of electrodynamics under Lorentz transformations was shown by Lorentz and Poincare before the formulation of the special theory of relativity. This invariance of form or covariance of the Maxwell and Lorentz force equations implies that the various quantities $\:\rho, \mathbf{J},\mathbf{E},\mathbf{B}\:$ that enter these equations transform in well-defined ways under Lorentz transformations. Then the terms of the equations can have consistent behavior under Lorentz transformations.
$\quad$The experimental invariance of electric charge and the requirement of
  Lorentz covariance of the Lorentz force equation (11.125) and (11.126) determines the Lorentz transformation properties of the electromagnetic field.




*(a) $\:\color{red}{\bf Classical\: Electrodynamics}$ [Jackson], 3rd Edition.


$\qquad\quad\:$$\S$11.9 Invariance of Electric Charge;
Covariance of Electrodynamics

$\quad$That $\:J^{\alpha}\:$ is a legitimate 4-vector follows from the invariance of electric charge.

$\qquad$(b) $\:\color{red}{\bf The\: Classical\: Theory\: of\: Fields}$, [Landau-Lifshitz], 4th Revised English Edition.
$\qquad\quad\:\:$$\S$28 The four-dimensional current vector.



*How can we prove charge invariance under Lorentz Transformation?, the accepted answer.





*How do we prove that the 4-current jμ transforms like xμ under Lorentz transformation?, ANSWER B.

A: Relativistic mass is an obsolete concept. Mass as defined as the energy in the rest frame, or as the 3+1D length of particle energy momentum, is invariant. Total charge, the volume integral of the charge distribution, is Lorentz invariant.
