For your safety should keys never be left near or inside a lock. The mechanism can get damaged or jammed. It may seems like a hassle to remove keys and keep it in a safe and secure place, but a small deed can safe a live.
Keys should also be looked after. Each lock (door and window) have their own keys. Rusty, broken or skew keys can let you be stuck inside or outside your home. It is also a soft target for criminals if the key gets broken inside the lock.