Beside some stretching exercises I usually did before basketball practice, I start slowly playing a warm-up-lick. Nothing special: put your first finger on lowest string at 1st fret, 2nd finger at 2nd fret, 3rd finger at the 3rd and the 4th (now brace yourselves...) at the 4th fret. Now move the strings up and down, start slowly and increase speed. Doing this for 5mins and you're all set ;-)
Before playing I stretch my fingerst and wrist a little bit, but not too much. After that I shake my hands a little and begin playing some light riffs, chords, scales or solo techniques, to warmp up, get the blood circulation going - for about 3-5 minutes. After playing I stretch my fingers somewhat heavier, together and separately on both hands forwards and backwards, for about 1-2 minutes.