Like Dissolves Like
The basic principle that decides if a substance will dissolve in another is "Like dissolves like." This means that if the molecules of the two substances share a common chemical property, one dissolves in the other. Otherwise, it does not. This forms the basis of the answer to the question, "Why does salt dissolve in water but not in oil?"
Why Salt Dissolves in Water
Salt or sodium chloride consists of sodium and chloride ions combined in an ionic bond to form a charged NaCl molecule. Water consists of a hydrogen atom and an oxygen molecule combined in a covalent bond to form a charged water molecule. The similarity between these two substances is that their molecules are charged. This is why salt dissolves in water. As salt is mixed into water, the charged water molecules break apart the charged salt molecules which are combined in a weaker ionic bond. As the molecules are broken apart, the positive ends of the water molecule surround the negative chloride ions and the negative ends of the water molecule surround the positive sodium ions. The sodium and chloride ions mix uniformly with the surrounding water molecules and thus salt dissolves in water, forming a homogenous mixture.
Why Salt Does Not Dissolve in Oil
Oil molecules do not contain any charge. Oil is comprised of long chains of hydrogen and carbon atoms linked to each other and does not carry any net charge. So, salt and oil are not "chemically alike." One is charged, the other is not. As a result, when salt is added to oil, no bonds are broken. Salt and oil simply do not mix. They remain separate as salt molecules and oil molecules.