The rider gets to keep which ever jersey he earns. There are rules about when he can wear it though. For example, during the Tour De France, riders try to make sure that two are not wearing it at the same time when it changes riders; so there won't be photos of both riders in yellow. The podium ceremony doesn't take place until the current yellow jersey wearer is over the line and changes into his regular team jersey, then the new rider will be presented with the day's winner's jersey.
One of the big point of conversation during the 2004 tour when Voeckler wore yellow for 10 days was that he now had one to keep for himself, and nine more to give to each of his teammates.
__________________