Suppose $X$ be a smooth projective curve over $\mathbb{C}$. Let $D$ be a divisor with $\deg D>0$ on $X$. Is it possible that $l(D)=0$, i.e. D is not linearly equivalent to an effective divisor?

If your curve is not rational or elliptic, i.e., $g\geq 2$ as Piotr commented, then there is a simple way to give an example: Let $D=P_1+P_2Q_1$ for some $P_1,P_2, Q_1\in X$ pairwise different points. Clearly $\deg D=1$, so if it were linearly equivalent to an effective divisor, which would have to be a point, say $Q_2\in X$. It follows that then there exists a rational function on $X$ with zeroes at $P_1$ and $P_2$ and poles at $Q_1$ and $Q_2$. In other words, there exists a degree $2$ morphism $X\to \mathbb P^1$ with $P_1$ and $P_2$ mapping to the same point. Hence this works already if $X$ is not hyperelliptic. If $X$ is hyperelliptic, then this morphism is given by the basepointfree linear system $K_X$. In that case choose a new $P_2$ (say $P_2'$) that's different from the original $P_2$. If $P_1+P_2'\in K_X$, then $P_2\sim P_2'$, which would imply (similarly as above) that $X\simeq \mathbb P^1$ and if $P_1+P_2'\not\in K_X$, then the above construction gives an example as desired. Remark actually it is not important that the basepointfree linear system in the second paragraph is $K_X$, just that it is some linear system. 


Another possible approach is the following one, using AbelJacobi map : if $g(X)\geq 2$, then AbelJacobi map gives an isomorphism $\varphi:Pic^0(X) \simeq \mathbb C^g/\Lambda$ for some lattice $\Lambda$. Now you can translate the map by some point $p\in X$; more precisely, define $\psi(D):=\varphi(D(p))$ for every divisor $D$ of degree $1$ on $X$. As $g\geq 2$, the image by $\psi$ of all points (seen as degree $1$ divisors) will be onedimensional inside the $g$dimensional variety $\mathbb C^g/\Lambda$. Therefore there exist on $X$ (a lot of) divisors of degree $0$ which cannot be written as $(q)(p)$ for any point $q$. Now consider such a divisor $D$, and define $D'=D+(p)$. It has degree 1, but if it were effective, it would be equivalent to $(q)$ for some point $q\in X$. Therefore one would have $D \sim (q)(p)$ which is impossible. 


Here's one way of seeing why Piotr's claim is true. Write $g$ for the genus of $X$ and begin with the following observation. If $p_1, \ldots, p_g$ are points on $X$, then the divisor $E=p_1+\cdots+p_g$ has $l(E) = g + 1  \rho$, where $\rho$ is the rank of the associated Brill–Noether matrix. This matrix is $g\times g$ so for points $p_1, \ldots, p_g$ in general poisiton, we'll have $\rho=g$ and consequently $l(E)=1$. (For a more precise statement, see §7c in Gunning, Lectures on Riemann Surfaces, PUP 1966.) Now take one such $E$ and consider the divisor $D=Eq$. We have $\deg D = g1 > 0$ and, for generic $q$, $l(D)=l(E)1=0$. If $g=0$ or $1$ then it follows easily from Riemann–Roch that $\deg D > 0 \implies l(D)>0$. 

