How to choose the best Gaussian surface? Are there some basic rules so that I could choose a Gaussian surface according to my physics problem? Are there any guidelines for how to choose an appropriate Gaussian surface for the system of charges you are analysing?
 A: Mathematically the Gaussian surface should be chosen so that 
$\vert \vec E\vert$ is constant on the surface so that
$$
\oint\vec E\cdot d\vec S = \int \vert\vec E\vert dS\cos\theta
=\vert\vec E\vert\int  dS\cos\theta
$$ 
so that evaluate the magnitude of $\vec E$ from the charged enclosed by
your surface.
In practice, choosing $d\vec S$ so that $\vert \vec E\vert $ is constant on the surface amounts to choosing a surface that has the same symmetry as $\vec E$.  Thus, if you can argue that $\vec E$ will be spherically symmetric, then your surface should be a sphere; if $\vec E$ has cylindrical symmetry, then the surface should be a cylinder etc.
The symmetry of $\vec E$ is often dictated by the symmetries of the charge distribution, i.e. a spherically-symmetric charge distribution will produce a spherically symmetric $\vec E$ etc, so the path to choosing an appropriate surface is 
symmetry of the charge distribution $\to$ symmetry of $\vec E$ $\to$ symmetry of the Gaussian surface.
Note that, in the case of a cylindrical or planar symmetry, the field must also be translationally invariant, i.e. a straight uniformly charged rod of finite length does not result is a cylindrically symmetric field over the entire length of the rod, so you can't use Gauss' law for this kind of configuration.
A: Choose the Gaussian surface in such that the electric field at every point on it is constant. Ultimately, you should be looking for symmetries, since it would simplify calculations a lot.
For example, consider finding the magnitude of the electric field due to an infinite thin sheet of charge, having a uniform positive charge density $\sigma$. We choose the Gaussian surface to be a cylinder going into the sheet and out of it. Finding the flux coming out of the Gaussian cylinder and splitting the integral for the flux coming out of the end faces, we have
$$
\oint_S \vec{E} \cdot \vec{dS} = \oint_{end face}\vec{E} \cdot \vec{dS} + \oint_{end face} \vec{E} \cdot \vec{dS}
$$
$$
\oint_S \vec{E} \cdot \vec{dS} = 2\oint_{end face}E dS\tag{1} = 2ES
$$
Since $\vec{E}$ and $\vec{dS}$ are in the same direction.
Equating $(1)$ to $\dfrac{q}{\epsilon_0}$ by Gauss's Law, we have,
$
E = \dfrac{q}{2S\epsilon_0} = \dfrac{\sigma}{2\epsilon_0}$, since $\sigma = \dfrac{dE}{dS} = \dfrac{E}{S}$
You could write it in vector form as $\vec{E} = \dfrac{\sigma}{2\epsilon_0}\hat{k}$, depending on the direction chosen.
