In order to recite a blessing over a fragrance, the scent must be for the purpose of smelling and not for the purpose of masking a bad smell or the like. In addition, the fragrance must emanate from some substance and not just be a scent without a source.
As such, one does not recite a blessing over air freshener since it is used to mask bad odors. (If it was purchased for the purpose of smelling and reciting a blessing, and not in order to mask a smell, then one would say the blessing of Borei Minei Besamim over it).
One recites a blessing over perfume that is in a bottle, since the fragrance originates from the perfume itself and is used to provide a pleasant scent. If one pours the perfume onto one's hand, one recites the blessing as long as the hand is still wet from the perfume. If, however the hand has dried, one cannot recite the blessing since there is only the scent that remained but without the substance from which it emanated. It should be noted that there are those who are of the opinion that, nowadays, one does not recite a blessing over perfume, but the Ohr LeSion rules as mentioned above.
(See Sh. 'A. 217: 2, 3. Ohr LeSion 14:35)