When is it better to fry with oil and when is it better to fry with butter?
Basically it all depends on temperature:

Every fat or oil has a specific smoke point (see here for a list), at which temperature it starts to degrade. That means, not all oils are suitable for every heat, or all types of frying. Some types of oil should remain "cold", like extra-virgin olive oil. 

Butter  has a rather low smoke point (325-375 °F or 163-190 °C) due to milk solids. So, frying with butter is a bit tricky temperature-wise, but often butter is choosen for taste. (Clarified butter, on the other hand, has a smoke point of ca. 485 °F or 252 °C, which makes it usable for pan- or deep-frying. The taste is somewhat similar to butter, but not equal.) 

As eggs are typically fried at a "low" temperature, using butter is fine. An example from the opposite end of the heat range would be asian cuisine, where food is prepared in a wok at very high heat. (I won't give recommendations what to use &amp; when, as there are subtle differences, even between brands. If in doubt, read the label.)

So, to cut a long story short: Decide what you want to do, how hot your pan is going to be and pick the matching oil.