It is possible that on a sphere $S^n$ there is a natural Riemannian metric in $R^(n+1)$. But it is not always possible for pseudo Riemann metric since the sum of two symmetric matrix which are not positive definite but may have rank different from the two matrix. So I wonder what is the sufficient and necessary condition for the dimension of a sphere which can be endowed with a Lorentz metric.

A compact simply connected manifold carriez a Lorenz metric iff its Euler characteristic vanishes. Proof: If $\chi(M)=0$, $M$ carries a nowhere vanishing vector field $X$. Pick up a Riemannian metric $g$ on $M$ (using a partition of unity argument) and denote by $\eta$ the 1form dual to $X$: $\eta(Y):=g(X,Y)$ for all $Y\in TM$. Then Conversely, if $M$ has a Lorenz metric $h$ of signature $(n1,1)$, pick again a Riemannian metric $g$ and consider the symmetric endomorphism $A$ of $TM$ defined by $h(.,.)=g(A.,.)$. The eigenspaces of $A$ corresponding to the unique negative eigenvalue define a line subbundle of $TM$ which is trivial if $M$ is simply connected, so $\chi(M)=0$. Therefore, the answer to your question is: $S^n$ carries a Lorenz metric iff $n$ is odd. 


I would just like to point out that a slightly more general version of the statement in Moroianu's answer holds: A compact orientable manifold $M$ admits a Lorentzian metric if and only if $\chi(M)=0$. Clearly, simplyconnected manifolds are orientable, hence the above statement is more general. But, e.g., tori clearly admit product Lorentzian metrics. For the proof of the above statement, recall $M$ admits a semiRiemannian metric of index $k$ if and only if the tangent bundle $TM$ admits a subbundle, or distribution, of rank $k$. Thus, $M$ admits a Lorentzian metric if and only if it admits a line bundle (which is also equivalent to $M$ admitting a vector field that never vanishes). The obstruction to the existence of a line bundle on $M$ is given by the Euler class of $M$ (see e.g. Davis and Kirk "Lecture notes in Algebraic Topology"). By the GaussBonnetChern Theorem, the Euler characteristic is the Euler class evaluated on the fundamental class of $M$, so that, for compact orientable manifolds, the obstruction is precisely $\chi(M)$. 

