Set a metronome at an easy tempo (say 50-60 bpm). Start out playing one note per click - quarter notes. Really focus on lining up exactly with the click. If it sounds like the metronome missed a beat, you hit that one dead on. Go for that every time!
Now, after you're comfortable hitting quarter notes, go for two notes per click - eighth notes. Give it a bit, then go up to three (eighth note triplets), four (sixteenth notes), five (quintuplets?), all the way up to eight, or even more if you can fit them in.
This exercise helps with overall timing, since you're working with a metronome, but also what I call "fluid timing", being able to measure a set space of time and fit any number of notes inside it. This leads to the ability to give the impression of stretching or compressing time to fit you, even though you are really stretching or compressing note values to fit the time. Classic examples - Jeff Pocaro for "stretching" (like the fill in the middle of "When a Man Loves a Woman" or "Africa") and Vinnie Colaiuta for "compressing" (any number of songs with those single stroke rolls).
More advanced - tap 2 notes per click with one hand, a foot, or even vocally, then go through the above exercise. 1, 2, 4, 6, and 8 are easy. 3, 5, and 7 don't line up. Now try three - only 3 lines up. Try this with every pulse, your timing abilities will increase dramatically! Got that down? Try keeping three timings going at once!
More Metronome Games! Play this MIDI click track while you do the exercise. Play each subdivision for four measures. After you've gone through all eight subdivisions, start over at the beginning, and the click changes to the next subdivision. The real trick is, don't "tune out" the subdivisions the click is playing, really focus on hearing how your notes line up with the click. It only takes about 7 minutes to get through the whole exercise!
Sky's the limit!