I created a giant skeleton statue and decided to spawn skeletons in the head. I put water in there just in case they burn, even though its completly dark. In a few hours, i came back and they were all gone. How long do they stay? And is there any way to keep them?
Light level does not affect skeletons despawning. There is no set limit on how long they can stay there, but they have a chance of despawning if you're further than 32 blocks from them, and will despawn instantly if you move over 128 blocks away from them.
To stop mobs from despawning, you can name them using a name tag, or set their "PersistenceRequired" tag to true using /entitydata.