The heat matters as much, if not more, than the oil, unless you're basically shallow frying (like, enough oil to not cover the egg, but still get halfway up it or so). Get the heat right, and only a bare touch of oil will be enough (or maybe, none at all). Get it wrong, and even a fair amount will still see you sticking.
What's really important is that it's hot enough before putting the egg in. Oil will help you here, because it will transfer the heat a bit better than the pan itself will. Make sure that the pan is preheated (meaning, as hot as you want to cook the egg on), and that the oil is also preheated (so, on the pan for at least 15 or so seconds before the egg is).
Also make sure you're using the right level of heat; if you have a laser thermometer or an electric griddle/induction range, this is easiest. Aim for something like 325°F/165°C. Much higher and your oil might burn, much lower and you'll end up sticking.
Ultimately I use just a tiny bit of oil - a faint spray from an oil mister - and don't usually stick when I cook my eggs, on a non-teflon nonstick pan (so, a pan that isn't quite as non-stick as the teflon ones).
One other note: you can season non-stick pans just like you season cast iron! Put a thin coat of oil on them, then heat them up until the oil is quite hot (some smoking is okay, but it will discolor the pan if it's not a dark color pan). If you're using Teflon pans (PTFE), be careful not to heat the pan beyond the safe temperature your manufacturer recommends, but the hotter the better for this up to that point. Let it go for a while, at least a minute or so. Then turn it off, and let it cool completely. Finally, wipe it out with a towel (but no soap/water). This page for example goes over this. You can do this to an older pan and regain much of the nonstick ability, as long as not too much has actually flaked off!