The reaction happens in two stages. In the first stage, a salt is formed - in this case, propylammonium chloride. This is just like ammonium chloride, except that one of the hydrogens in the ammonium ion is replaced by a propyl group.
CH3CH2CH2Cl + NH3 → CH3CH2CH2NH3+ + Cl-
If the ammonia is in excess a further reaction can occur:
CH3CH2CH2NH3+ + Cl- + NH3 ↔ CH3CH2CH2NH2 + NH4Cl
The ammonia removes a hydrogen ion from the propylammonium ion to leave a primary amine - propylamine.
The more ammonia there is in the mixture, the more the forward reaction is favoured.