Riemann's original proof (as modified by Roch) showed that for D > 0 the space of differentials of functions in L(D) is the kernel of a linear period map from C^d--->C^g. Hence the dimension l(D)-1 of that kernel satisfies d-g ≤ l(D)-1 ≤ d. Equivalently, 1+d-g ≤ l(D) ≤ d+1. He also showed that deg(K) = 2g-2, and l(K) = g. It is trivial that d<0 implies l(D) = 0.
Roch showed that the cokernel of that map has dimension l(K-D), hence l(D) - l(K-D) = 1+d-g.
The easy (formal) consequences are these:
d = deg(D) > 2g-2 implies l(D) = 1+d-g, i.e. l(D) is minimal when deg(D) > deg(K).
d = deg(D) > 2g-1 implies D is free, since l(D-P) must go down one, by 1).
d = deg(D) > 2g implies D is very ample, since both l(D-P) and l(D-P-Q) go down.
Since these consequences are easy, the interesting cases are for d = deg(D) ≤ 2g-2. The first one of these is that K is very ample unless there exist P,Q with l(P+Q) > 1.
The next important, less formal result is that for 1 ≤ d ≤ 2g-1, one always has 2.l(D)-2 ≤ d, a generalization of the case for D = K. Moreover, equality holds if and only if either D = K or D is a multiple of a divisor P+Q as above with l(P+Q) > 1.
Good sources for this are Griffiths - Harris for Riemann and Roch's proofs, and Arbarello - Cornalba- Griffiths - Harris for the refinements. I have written a longer article on the topic available free on my website at roy smith's web page at university of georgia math department.