If you want to learn something and actually retain the knowledge, there's no point cramming - extensive and lengthy periods of solid study. You might manage to pass an exam, but after a few weeks or months (let alone years) you forget most of it. I speak from personal experience!
A post by Peter Evgan on using flashcards for learning reminded me that I really should do a post about this as well. I've been using the same application Anki as an aid to learning - and more importantly, remembering what I've learned.
Anki is a program which makes remembering things easy. Because it's a lot more efficient than traditional study methods, you can either greatly decrease your time spent studying, or greatly increase the amount you learn.
The secret to something like Anki is being asked a question (e.g. on the front of a "card") and trying to recall the answer (written on the back of the "card"). This act of recall (active recall testing) strengthens your memory. Another important element is something called spaced repetition: spreading the questions over time with a schedule to repeat based on how well you do in recall. This schedule, and the feedback you give on your recall, reinforces the memory and stops the knowledge fading away.
There's a real science and lots of research behind the spaced repetition study method, enough to really hammer home its utility. Some reading :
As Derek Sivers says in the first link above :
.. memory research shows that the most effective and efficient time for a new fact to be remembered is right before you were about to forget it.
A tool like Anki tracks your learning and calculates the best schedule to reinforce the memory. I've been using it to teach myself the Vim text editor and it's helping enormously,
However, the key to this technique is creating the cards. You have to be a little careful here and make sure you understand the fact (or knowledge) you're setting down on the card.
Anki makes this all much easier. Not only is it free, it works on Windows, Mac, Linux, Android and iPhone. And another key feature is that you can synchronise the Anki state across all your devices.
The Anki manual introduction explains the system and describes why it works so well. I recommend you have a read and try it out. There's always something worth learning.