Picture creaming butter and sugar together in a mixer when you're making a cake: you get a fluffy, creamy substance. Now imagine beating oil and sugar together: the result looks like wet, heavy sugar. That's because butter incorporates and holds tiny air bubbles while oil does not.
But that doesn't mean oil is all bad in baking. Oil makes cakes moist and tender–like my favorite carrot cake, which is made with oil (and no butter). But I wouldn't much care for a pie crust made with oil: I want both the flaky light texture and great flavor that butter contributes.
There is no hard and fast rule for how much oil it takes to replace butter: it varies by recipe. Start with a cake, muffin or cookie recipe. (Stick with butter or shortening for pie crusts). Try substituting one-fourth or half the butter with oil. And don't substitute the same amount: try two thirds to three fourths as much oil. In other words, to replace 4 tablespoons of butter, experiment with a scant 3 tablespoons of oil.
For more information about ingredient substitutions, see our Ingredient Substitutions guide.