When you engines oil is dirty and has sludge built up in it then it can affect the engines performance which can cause your engine to lose a little fuel economy.
So changing your engine oil can help improve your gas mileage somewhat but changing the engine oil won't make a huge difference in fuel mileage.
Other things that can improve your fuel mileage are properly inflated tires, new spark plugs, spark plug wires ignition coils and not speeding.