Different types of mosquitoes react to varying stimuli. Most mosquitoes are active at dawn or dusk, some hunt your blood during daylight. The aromatic scent of lavender , you would think should attract insects. Lavender oil, however, actually repels mosquitoes and gnats.
Mosquitoes have an extremely limited olfactory system and lavender oil blocks the ability of the mosquito to smell out food sources - namely you. So when used as an oil , applied to the skin, it will work for some time, but like any repellents , be they chemical or natural , they will wear off.
Lavender plants work well, and don't wear off as the oil does.
Planted in conjunction with citronella grass, feverfew, lemon grass or Pennyroyal it works even better as the properties of the combined plants add more protection when strategically placed.