So I'm in the water and there's a skeleton above me shooting me only have one heart left I logged off the server will the skeleton despawn?
If you are playing single player then it should not despawn. You must leave the chunks and when they unload mobs can despawn.
Accordin to this stackexchange answer:
As of Minecraft 1.8, these are the two main despawning rules:
If a mob has not been within 32 blocks1 of a player for more than 30 seconds, it has a 1 in 800 chance every tick of despawning (about 1 in 40 every second) If there are no players within a 128 block radius2 of a mob, it will instantly despawn
Mobs with nametags will never despawn, except... Mobs which have picked up items (i.e. were not spawned with that item) will never despawn, except... When the gamemode is set to peaceful, all hostile mobs will despawn (including those with nametags, or those who have picked up items) Passive mobs will never despawn (except chickens originally spawned as chicken jockeys, which will follow zombie despawning rules)
If you log off and there are no other players online, the server should immediately unload all chunks and all mobs within.
Edit: I found an interesting fact while searching the wiki that may help in this type of situation,
If a hostile mob is tracking a player, the player can separate him or herself and the mob through a wall, relog, and the mob will no longer be tracking the player.