Local complete intersections which are not complete intersections The following definitions are standard:
An affine variety $V$ in $A^n$ is a complete intersection (c.i.) if its vanishing ideal can be generated by ($n - \dim V$) polynomials in $k[X_1,\ldots, X_n]$. The definition can also be made for projective varieties.
$V$ is locally a complete intersection (l.c.i.) if the local ring of each point on $V$ is a c.i. (that is, quotient of a regular local ring by an ideal generated by a regular sequence).
What are examples (preferably affine) of l.c.i.  which are not c.i. ? I have never seen such one.
 A: (To supplement Alberto's example)
If $V$ is projective, then the gap between being locally c.i and c.i is quite big. In particular, any smooth $V$ would be locally c.i., but they are not c.i. typically. For instance, take $V$ to be a few points in $\mathbb P^2$ would give simple examples. In higher dimensions, by Grothendick-Lefschetz, if $V$ is smooth, $\dim V\geq 3$, and $V$ is c.i. then $\text{Pic}(V)=\mathbb Z$, so it is a serious restriction.
The affine case is more subtle. Again one can look at smooth varieties. If $V$ is a smooth affine curve and c.i., then the canonical bundle of $V$ is trivial. So it gives the following strategy: start with a projective curve $X$ of genus at least $2$, removing some general points to obtain an (still smooth) affine curve with non-trivial canonical bundle.
For more details on the second paragraph, see this question, especially Bjorn Poonen's comments. This paper contains relevant references, and also an example with trivial canonical bundle.
A: Varieties in an affine space.


*

*in characteristic zero any lci $X\subseteq\mathbb{A}^n$ is a set-theoretic complete intersection.

*In characteristic $p$ any lci curve $C\subseteq\mathbb{A}^n$ is a set-theoretic complete intersection.


Projective varieties 
Let $X\subseteq\mathbb{P}^n$ be a smooth non-degenerate degree $p$ (a prime number) variety of codimension $c$. Then $X$ is not a scheme-theoretic complete intersection. Indeed, if $X = H_1\cap H_2\cap...\cap H_c$, then $deg(H_2)=...=deg(H_c) = 1$ and $deg(H_1) = p$ by Bezout's theorem because $p$ is prime. Therefore $X$ would be degenerate. An example is again the twisted cubic $C\subset\mathbb{P}^3$. However $C$ is a set-theoretic complete intersection. There exist a quadric surface $Q$ and a cubic surface $S$ such that $Q\cap S = 2C$ (i.e. $Q$ and $S$ are tangent along $C$). 
Hartshorne Conjecture: If $X\subseteq\mathbb{P}^N$ is a smooth variety of dimension $n$, codimesnion $c$ and $c\geq 2n+1$ then $X$ is a scheme-theoretic complete intersection. 
Hartshorne Conjecture has been proven for Fano varieties of codimension two and quadratic varieties (i.e. varieties that can be defined just by quadratic polynomials).
Thanks to Barth’s result: Barth, W.: ”Transplanting cohomology classes in complex-projective
space”, Amer. J. Math., 92, 951-967 (1970),  and since no indecomposable rank
two vector bundle on $\mathbb{P}^N$, $N\geq 5$, is known, it is generally believed that any
smooth, codimension two subvariety of $\mathbb{P}^N$, $N \geq 6$, is a complete intersection. The main results for codimension two subvarieties can be summarized as follows: let $\omega_X\cong \mathcal{O}_X(e)$, $d$ the degree of $X$ and $s$ the minimal
degree of an hypersurface containing $X$. if $e \leq N + 1$ or if $d < (N − 1)(N + 5)$ or if $s \leq N − 2$, then $X$ is a complet intersection. For $N = 5,6$ we can something more: let $X \subset \mathbb{P}^6$ be a smooth, codimension two subvariety, if $s\leq 5$ or if $d \leq 73$, then $X$ is a complete intersection. Let $X \subset \mathbb{P}^5$ be a smooth, subcanonical threefold. If $s \leq 4$, then $X$ is a complete intersection. This is Theorem 1.1 of http://arxiv.org/abs/math/9909137.
A: The first example is the twisted cubic in $\mathbb{P}^3$.
A: From Hailong's answer, I suppose it is possible to make simpler examples as follows: take $V$ a smooth affine variety which is not equidimensional (so clearly it is l.c.i but not c.i). For instance, $V$ is the union of the plane $z = 0$ and the line $z=1, x=y$ in $\mathbb A^3$. $V$ is smooth (it can be proven that $I(V) = (zx-zy, z^2-z)$).
The disadvantage of this construction is $V$ must be reducible.
Please correct me if I'm wrong.
A: EDIT: This is wrong. I haven't deleted it in order that the subsequent comments make sense.
You will never see an example, for the following reason: given a local complete intersection $V$ inside $\mathbb{A}_k^n$, you can always find a global complete intersection $W$ inside $\mathbb{A}_k^n$ such that the reduced varieties associated to $V$ and $W$ are the same.
Proof:
Suppose $I$ is an ideal of $k[X_1,\dots,X_n]$ such that the variety $V(I)$ is a local complete intersection. This forces all the local rings of $V(I)$ to be Cohen-Macaulay, hence equidimensional. So the irreducible components of $V(I)$ all have the same codimension in $\mathbb{A}_k^n$; lets call this codimension $r$.
Since $k[X_1,\dots,X_n]$ is Cohen-Macaulay, the height of $I$ (which is $r$) is the same as its depth, meaning that $I$ contains a regular sequence $f_1,\dots,f_r$ of length $r$. By considering heights we see that the minimal primes over the ideal $J=\langle f_1,\dots,f_r\rangle$ are the same as the minimal primes over $I$. Therefore $J$ and $I$ have the same radical, which implies the claim (with $W=V(J)$). QED
So if you are trying to draw counterexamples, you have to worry about whether that line on the paper has nilpotent elements in the structure sheaf...
