Yes, uniformed officers salute the president. (Although not a uniformed officer, he is technically the Commander in Chief of the armed forces as a whole, therefore outranking literally everybody in the chain of command.)
When you salute someone, you do not end your salute until they acknowledge it. From someone else in uniform (and covered, ie wearing a hat), this is typically a return salute. An acknowledgement may, however, be a simple nod.
Proper military protocol for an officer coming into the presence of the President would be to salute and hold it, then wait for the president to nod (NOT SALUTE) in acknowledgement before dropping his salute.
Yes, you pretty much have to salute until acknowledged. Not acknowledging a salute is a form of dressing-down: if an officer is pissed off at you about something, he'll leave you hanging for a while while he stares at you. Sort of like a civilian executive having someone shown in to his office, but not bothering to look up from his desk and whatever paperwork he's pretending to occupy himself with for a while.
In VERY extreme cases, the officer you salute may fail to return your salute at all. In that case, once his attention leaves you entirely - for example, he turns his back on you - you may drop the salute. Not having your salute returned at all is a VERY extreme show of disrespect. It generally reflects very poorly on the officer who does it - it's acceptable to leave somebody to sweat for a few seconds while you glare at them if you're angry as hell at them about something, but you really shouldn't ever FAIL to return (or acknowledge) the salute at all. The only exception would be in wartime conditions when salutes are supposed to be suspended (to avoid giving snipers an idea who to shoot at) and the lower ranked person shouldn't have saluted in the first place.
It doesn't actually matter a bit whether the president is wearing a hat or not, because he's in civilian clothes. If you're in civvies, you don't salute. I only mention the hat because it's just another example of how VERY far from actual military protocol the president saluting anybody really is.