Question: I am teaching myself to program in C and have been for a few months. I recently took a one month break and came back a week ago, and it's all gone. I had to look up some things that I really put effort into understanding (see: pointers) and some others just stuck with me. Now learning about `malloc` and dynamically allocated memory is also getting a bit tough.

What do you suggest for keeping it all retained? Will it just come with time and experience?

Answer: 
Practice, practice, practice. You'll still forget things that you haven't used for a while, but the more you practice, the faster they'll come back to you. Also, (in line with @Telastyn's comment), emphasize understanding things, not memorizing them.
Another Great way is to TEACH, I know it may seem strange,But As soon as you learn teach that stuff to some one, Because while teaching the brain works different, you have to think how the person in front of you is thinking, he will ask you many doubts and you always have to Say the same thing again and again but with different angles.This will make you understand and remember concepts permanently.