There is a claim that drinking coffee right after learning something helps you remember what you learned up to 24 hours later. Is it true? If it is, then how it effects the memory?
There was an episode of myth busters they were testing is it better to stay wired or tired and the outcome was you cognitive skills improve when you are wired on caffeine.
Now I don’t know about memory but I am sure all the answers you are going to receive will be highly subjective...but the above mentioned episode is the closest thing to a scientific answer we will ever get IMO.
A preliminary search seems to reveal no definite answer. One study on rats had them complete train/learn a water maze and some were given caffeine at different stages: pre-training, post-training, and none at all.
Post-training administration of caffeine improved memory retention at the doses of 0.3-10 mg/kg (the rats swam up to 600 cm less to find the platform in the test session, P£0.05) but not at the dose of 30 mg/kg. Pre-test caffeine administration also caused a small increase in memory retrieval (the escape path of the rats was up to 500 cm shorter, P£0.05). In contrast, pre-training caffeine administration did not alter the performance of the animals either in the training or in the test session. These data provide evidence that caffeine improves memory retention but not memory acquisition, explaining some discrepancies among reports in the literature. 
Which agrees with your hypothesis that caffeine helps memory retention. However, some other studies on humans claim no or negative correlation between caffeine and memory retention (, ), albeit they had small sample sizes.