Basically fat and oil have almost same chemical structure unless the saturated and the unsaturated hydrocarbon groups present. Saturated means there will be carbon-carbon single bonds and the bonds are sigma bonds which are stronger. That's why saturated groups having are solid at room temperature and that's fat. On the other hand, unsaturated groups having compounds are liquid at room temperature and these are oil.
The basic difference is the saturated and unsaturated hydrocarbon group.