Beans get oily when they have been roasted beyond the point where the cell walls rupture and the oils stored inside the cell wall vacuoles are released. This stage, while roasting, is roughly marked by a crackling noise called the 2nd crack (the first crack happens at a lower temperature when the water turns to steam).
If the roast is very dark, so the beans are a dark chocolate color or darker, the oil will be on the bean from the day of the roast and stay there until it is about 3 to 4 weeks old, at which point it will all have evaporated. The sight of beans this color without oil is a warning that the coffee is stale. If the roast is a bit lighter, milk chocolate color, the oil will take about 3 days to a week to appear on the bean surface. In some parts of Europe, which like this level of roast, the saying is that a bean without oil is either too old or too young. Beans lighter than milk chocolate have intact cell walls and will never get oily, and that will not be a clue about freshness or otherwise.
So much for the facts, what about the taste?
Advocates of lighter, oil-free roasts claim oily beans taste rancid. Advocates of oiled roasts say that without them appearing through roasting, the oils cannot get into the cup, since grinding alone leaves most cell walls intact. There is a bit of truth to both these statements, and in terms of the flavors in the coffee oils, a medium, milk chocolate roast, fairly new, and just showing a few spots of oil, will taste the best.
However, not all things are equal. The darker one roasts, the more one roasts out the fruit and floral flavors in the coffee. On the other hand, very dark roasts have spice and smoke flavors that many people enjoy. These flavors have nothing to do with the oils.
Finally, among people who make a hobby of espresso, you will probably find nobody who will willingly drink a coffee whose beans are so oily that they foul the grinder. I hesitate to say that roasts this dark are the Thunderbird or peppermint schnaps of coffee, but it wouldn't be an entirely unfair statement.