Some examples for Q-Gorenstein variety and Gorenstein variety. Could you give us an variety X which is Q-Gorenstein variety, but this variety is not Gorenstein variety?
What is the canonical divisor K_X on X? How can we compute its canonical divisor?
Could you give us an variety which is not Gorenstein variety?
What is the canonical divisor K_X on X? How can we compute its canonical divisor?
 A: Cones are usually a good source of examples when it comes to questions like these. In your case, let $Y\subset \mathbb{P}^5$ be the Veronese embedding of $\mathbb{P}^2$ and let $X\subset \mathbb{P}^6$ be the projective cone of $Y$. Then $X$ is a normal non-Gorenstein variety which is not Gorenstein. Indeed, Let $L\subset Y$ be the image of a line in $\mathbb{P}^2$ and let $D$ be the Weil divisor given by the cone over $L$. Let $H$ be the generator of $Pic(X)$, that is, the hyperplane section from the embedding in $\mathbb{P}^5$. Then $-K_X=3D$ is not Cartier (as you can see by blowing up the vertex of the node and use the adjunction formula). But $2K_X$ is certainly Cartier as $2K_X\sim -6D\sim -2H$. 
A: Let me give a couple more examples to complement what J.C.Ottem already said.
First I'll point out a couple discrepancies in terminology for a normal variety:
Gorenstein:  This means that both $K_X$ is Cartier and $X$ is Cohen-Macaulay.
$Q$-Gorenstein:  This means that $nK_X$ is Cartier for some integer $n > 0$.  
Quasi-Gorenstein (or $1$-Gorenstein): This means that $K_X$ is Cartier but that $X$ is not necessarily Cohen-Macaulay.
In particular, $Q$-Gorenstein does not usually imply Cohen-Macaulay (because of this a lot of people don't like the terminology, notably János Kollár).  On the other hand, some people like to require the Cohen-Macaulay condition in their $Q$-Gorenstein definition (adding to the confusion).  It would also be "reasonable" to require that some canonical cover of $X$ is Cohen-Macaulay!
Ok, let me at least state the general rule for when a cone (or rather a section ring) is $Q$-Gorenstein or Gorenstein.  
First note that because $S$ is graded, a module is free of rank one if and only if it is isomorphic to $S$ itself (up to a shift in grading).
Suppose that $X$ is a smooth (or even Gorenstein) projective algebraic variety over a field $k$ and suppose that $L$ is an ample line divisor.  Form the ring:
$$
S = \bigoplus_{k \in \mathbb{Z}} O_X(kL)
$$
and let $m = S_+$ denote the irrelevant ideal.
Also form the $S$-module
$$
\omega_S = \bigoplus_{k \in \mathbb{Z}} (\omega_X \otimes O_X(kL))
$$
I claim that $\omega_S$ is the canonical module of $S$.  This is actually pretty easy to see, $S$ is always normal so $\omega_S$ is determined on $U = \text{Spec} S \setminus m$.
Therefore since $f : U \to X$ is a $\mathbb{A}^1$-bundle it follows that $\omega_U$ is just $f^* \omega_X$ which it is easy to see coincides with $\omega_X|_U$.  
Then 
Theorem (quasi-Gorenstein): The ring $S$ is quasi-Gorenstein if and only if $K_X \sim nL$ for some integer $n$ (possibly $n = 0$).
The proof idea is as follows.  Since $K_X \sim nL$, it follows that $\omega_S$ is just $S$ shifted over by $n$.  But that's a free module.  Conversely, if $\omega_S$ is a free module, since $S$ is graded, it must be a shift of $S$.
Theorem ($Q$-Gorenstein): $S$ is $Q$-Gorenstein if and only if $mK_X \sim nL$ for some integers $n$ and $m \neq 0$.
The proof idea is similar, it follows from the same sorts of arguments as above that $$O_{\text{Spec} S}(mK_S) = \omega_S^{(m)} = \bigoplus_{k \in \mathbb{Z}} O_{X}(kL + mK_S).$$  Therefore for this to be free, we need exactly $mK_S = nL$ for some integer $n$.  
Theorem (Cohen-Macaulay): Finally $S$ is Cohen-Macaulay if and only if $H^i(X, O_X(kL)) = 0$ for all $\dim X > i > 0$ and all $k \in \mathbb{Z}$.  
Note that the points away from the origin are Cohen-Macaulay since $X$ was smooth (or at least Gorenstein $\Rightarrow$ Cohen-Macaulay).  The point is then that $[H^{i+1}_m(S)]_k = H^i(X, O_X(kL))$ where $[\bullet]_k$ is the $k$th graded piece of the module.  This follows from computations in Cech cohomology.
The upshot:
This gives us lots of examples of varieties that are $Q$-Gorenstein or not.
Fano: If $X$ is Fano (meaning $-K_X$ is ample) and we take $L = -K_X$, then $S$ is certainly quasi-Gorenstein.  On the other hand, if we take $L = -mK_X$, then $mK_X = (-1)L$, $S$ is $Q$-Gorenstein.  
Now let's suppose we are in characteristic zero and that $X$ is smooth.  If $k > 0$, we have $H^i(X, O_X(kL)) = H^i(X, O_X(K_X + (m-1)K_X + (k-1)L) = 0$ by Kodaira vanishing.  If $k < 0$, by Serre-duality, $H^i(X, O_X(kL)) = H^{\dim X - i}(X, O_X(K_X - kmL)) = 0$ by Serre vanishing.  On the other hand for $k = 0$, $H^{i}(X, O_X) = H^i(X, O_X(K_X - K_X)) = 0$ by Kodaira vanishing.  Thus $S$ is Cohen-Macaulay.  
Calabi-Yau: If $X$ is Calabi-Yau (meaning $K_X = 0$) and we choose any ample $L$, then $S$ is quasi-Gorenstein.  It may not be that $X$ is NOT Gorenstein though, it depends on the vanishing of $H^i(X, O_X(kL))$.  For example, an Abelian surface has $H^1(X, O_X) \neq 0$.
Others: If $K_X$ is neither ample nor anti-ample, nor $Q$-trivial, then you are out of luck.  The cone will never be $Q$-Gorenstein.
A: It is also quite easy to generate a lot of examples with toric geometry. We have next characterization:
Let $\Sigma$ be a fan in a lattice $N$ and $M = N^*$ dual lattice. Then

*

*$X_{\Sigma}$ is $\mathbb Q$-Gorenstein iff for each cone $\sigma \in \Sigma$ generated by $n_1,...,n_r \in N$ there is $m \in M \otimes \mathbb Q$ such that $(n_i,m) = 1$ for every  $i=1,...,r$

*$X_{\Sigma}$ is Gorenstein iff for each cone $\sigma \in \Sigma$ generated by $n_1,...,n_r \in N$ there is $m \in M$ such that $(n_i,m) = 1$ for every  $i=1,...,r$
For example for a complete fan with generators $(-1,-2),(1,0),(0,1)$ in $\mathbb Z^2$ we can check that the only solution of system $-1x-2y=1, x=1$ is $(1,-\frac{1}{2})$. So $X_{\Sigma}$ is not Gorenstein, but $\mathbb Q$-Gorenstein. In fact, $X_{\Sigma} \cong \mathbb P(1,1,2)$ in this case.
