Logging off, aka CTRL+Q, DOES NOT WORK TO SAVE YOU ANYMORE. Since the ~WINTERISCOMING~ update, logoffski mechanics have been changed. The mechanics involving the essentials of logoffski, EWarp, Modules and Log-in warp still exist, however. More or less, if you get in combat, just lose the ship or try to get out of the situation, because logging off WILL NOT SAVE YOU ANYMORE. You will likely be probed and destroyed if you have been aggressed on or if you yourself have aggressed another. You can still logoffski if you're dying and not warp scrammed in your sanctum, though.
From CCP: “After a player logs out, there is a check for player aggression every 15 minutes. If you have been aggressed, the timer extends for 15 minutes; if you have not been aggressed, you disappear as before. Note: this is only for player aggression and will not change what happens when you log off during fights against NPCs.”
For posterity's sake, we can talk about how it used to be:
Please note that if done incorrectly (and sometimes at all), logging in space will get you killed. It will also make you lose all your space honor and e-bushido.
Everything here has been directly tested, except where otherwise noted. Use care when changing things here; make sure to verify the info you have, or it could result in shitty deaths.
If you CTRL+Q you can still die. Don't be an idiot and expect it to save you from every situation (Especially if you're a cap pilot!), or even most situations. Use scouts, use stabs, use your fucking brain before trusting your ship to undocumented game mechanics and borderline exploits. It's not a matter of e-honour but one of survival.
There are some basic rules the game follows when logging off in space. These should give you a good feel for how this operates, but reading what happens in all situations is a very good idea.
In general, if you log off, your ship initiates emergency warp to a random point about 1 million km away from where you logged off, and then sits there in space for a little while before disappearing completely. Once your ship has completely disappeared, it is no longer at risk - it is essentially no longer in the universe at all. There are, of course, situations where the length of time your ship sits in space varies, and even whether or not it initiates emergency warp. If your ship is destroyed after logging, you will pop out in a pod, which can also be destroyed. While it may be obvious at this point, your ship (and pod) can be targeted after you log out, just as if you were logged in.
If you are unable to warp when you log out (pointed/bubbled), your ship will also be unable to initiate emergency warp. Furthermore, so long as someone shoots/agresses you every 15 minutes, your ship will not disappear from space!
First, we look at what affects how long your ship sits in space. This is entirely predicated on aggression. At the most basic, if you are not aggressed, and as such have no aggression timer, then your ship will disappear in roughly 60 seconds. If you have an aggression timer, then your ship won't disappear for 15 minutes. Note that your ship sits in space for 15 minutes no matter how much longer your aggression timer has left on it. It is also important to note that aggression timers are specific to the system you get them in. In other words, if you get a timer in one system and leave before it runs out, you won't have one in your new system. However, if you reenter the original system, the timer starts again right where you left it. It should also be noted that if you are aggressed within about one second of logging, you will count as having logged aggressed and make you wait 15 minutes to disappear. This usually occurs if you Ctrl-Q in a bubble - your e-warp will be stopped due to the bubble, agressing you.
Once logged out, however, this 1 or 15 minute timer is absolute. For example, if you weren't aggressed beforehand, but get shot at after you log, your ship will still disappear after 60 seconds. When logging back in after getting aggressed in this manner, you will have a 15 minute aggression timer, so immediately relogging will put your ship in space for 15 minutes. This applies even if you were logged out of Eve for longer than 15 minutes.
Assuming you do initiate emergency warp (discussed next), enemies in the system will have to scan down your ship to find and shoot at you. While it is hard to scan down a ship in just 60 seconds, a skilled covops pilot with some prior knowledge of where you were in space when you logged can certainly do it. He would have some issues getting a fleet to your ship's location fast enough to kill you, though. As such, logging at a safespot without an aggression timer is usually a fine thing to do. However, be aware that with a 15 minute timer, getting probed out and a fleet on you is not all that hard if the enemy fleet is determined to do it.
“The aggression timer for combat has been changed. When logging off in space with PVP aggression, the ship will be removed from space 15 minutes after log-off, or 15 minutes after the most-recent aggressive act against the ship, whichever is the latest.”
This essentially means that even if you logout under aggression, the 15 minute timer restarts each time a new act of aggression takes place. What this implies is that if you are under attack, your ship will never logout until the aggression stops, thus ending the viability of the logoffski.
Whether or not your ship actually warps off when you log off is another variable here. The general rule is that if you are otherwise able to warp, then you will initiate emergency warp. Otherwise, you won't. So, if you were in a warp disruption bubble or a dictor bubble or getting warp scrambled/disrupted before logging, you will not initiate emergency warp. Even if you are cloaked from jumping through a gate, if you log off while in a dictor or anchorable, this will aggress you - you will sit in the bubble for 15 min, not 60 seconds. Do not try to Ctrl-Q if you find yourself in a warp disruption bubble! Also, if you get warp scrambled/disrupted after logging but before warping off, you will fail to e-warp. Finally, your ship only attempts e-warping once, so if the source of warp disruption goes away before your ship has disappeared, it still won't warp off. Long story short, if your ship is stopped from warping before it can actually enter warp, then it will be sitting there until it times out and disappears (or is destroyed).
When you log back in, you will appear at a random location 1 million km from where you logged off, which is NOT the same as the location you warp to when you log off. You will then warp to where you were when you logged off, and you'll be pre-aligned at about 1/3 speed.
Log-in warp is not affected by bubbles: You will not get sucked in to inline bubbles, and you will land inside any bubbles deployed on your log-out spot, not on the edge.
You can not cancel the log-in warp. Pre-Tyrannus, it was possible to interrupt the log-in warp by logging out while aligning, which would cause you to e-warp, and would cause your next log-in to put you in safespot instead of a potentially-hazardous grid. Post-Tyrannus, it is no longer possible, your ship will not attempt to e-warp until it lands back on its original grid.
Logging out of warps appears to have different behavior: Similar to the old behavior, you will exit from warp immediately (possibly at warp speed) and attempt to e-warp, and upon logging back in, you will warp back to the location that your ship was when it disappeared (not 1 million km from the logout point, meaning you can still slingshot to create bookmarks), followed by a warp to your original destination.
Modules turn off when you log off, immediately ending their cycles. Most importantly, things like MWDs and ABs shut off, as do cloaks. When you log off, you will be decloaked, even covops and ships that fit covops cloaks. However, your ship will probably enter e-warp, barring the conditions above. It is a current bug, as noted by CCP, that occasionally a cloaked ship will simply decloak and sit there until it times out. So, logging with a cloak active can be a little risky, especially with enemies in the immediate area. And if you figure you'll be protected by active shield hardeners or something after logging, you're just a fuckwit.
There are a few special cases with their own rules. These are listed here.
If logging out in a POS shield, you will not warp away. Normal aggression rules still apply, however. Log-in warp still applies.
Specifically, getting scrambled or whatnot, then having your ship destroyed, appears to allow your pod to warp away after it pops out. However, more testing would be helpful when it comes to what your pod does after your ship dies, all after you've logged.
If your ship is using a Cynosural Field Generator, it will not disappear until the cyno expires. If your ship is destroyed while logged out and the cyno is active, the cyno will remain warpable for the rest of its normal duration, your pod will attempt to e-warp, and will not disappear for 15 minutes.