Dear student,
Na and K are highly reactive to water and air. They are placed at the top of the reactivity series which is based on the chemical reactivity of elements. To prevent it from even a trace amount of H2O it is stored under kerosene.
Kerosene is a non-polar(covalent) compound. It has no affinity for moisture. A kerosene sample does not contain even a trace amount of water. Moreover it prevents the exposure of metals (Na and K) to the atmosphere. That is why the reactive metals like Na and K are kept in kerosene.
Regards