it seems to me that my 25.5" scale guitars generally stay in tune better than 24.75" scale guitars, and that guitars with maple necks are more stable than guitars with mahogany necks. any kind of non-double-locking tremolo makes tuning more unstable; having the bridge and nut slots optimized for your string gauge and setup is essential here and adviseable for all guitars for better tuning results. if one of your strings goes "PING!" and suddenly changes pitch while you're tuning, the nut slot is too narrow.
tuners don't seem to make that much difference as long as they're of good quality, except on my Tokai Les Paul Special...those fucking Kluson-type tuners still don't stay in tune worth a damn now any more than they did in 1970. that's my least stable guitar tuning-wise; probably the best electric was my Epiphone Les Paul Custom which i just sold. to my knowledge it had an all-mahogany body and a maple neck with Grover tuners, and often was in perfect tune when i took it out of the case after months. my Telecaster is also really good tuning-wise, as is my Eastman AC512 000-sized acoustic. IMO the effectiveness of locking tuners for stabliizing tuning is hype...it didn't help my Strat, and properly wound non-locking tuners shouldn't be a problem if they're of good quality. they're great for quick string changes, but otherwise don't seem to offer any real benefits in my experience.