Yhe act of shooting your gun by itself doesn't alert enemies, because X-Com doesn't have a sound system (yet, heh heh). But if you hit a unit, that unit will automatically spot you, as per vanilla X-Com mechanics (which is why an enemy can turn and react when you shoot them in the back). If this unit is a spotter, then they will report your position to any snipers.
(Apologies if the above is rubbish, I just infer from my experience and bits of knowledge, not the code itself.)
As for the duration of spotting, in almost all cases it's 1 full turn.