Monsters (not holding items or wearing armor) and squid (but not animals), including hostile wolves as of 1.1, can cease to exist, or "despawn", under certain conditions:
A mob that has had no player within 32 blocks of it for more than 30 seconds has a 1 in 800 chance of despawning on each game tick (1/20th of a second). Therefore, the half-life of monsters not within 32 blocks of a player is 27.73 seconds (after the initial 30 seconds have elapsed).
A mob will immediately despawn if there is no player within 128 blocks of it. Note that this is a Euclidean sphere, not a cylinder from map top to bottom and not a taxicab sphere (which is more like an octahedron). Example: A mob at 0/y/0 will remain at least 30 seconds (as above) if the player moves to 65/y/65 (real distance 91.9), but despawns immediately if the player moves to 91/y/91 (real distance 128.7).
All hostile mobs (including those that are holding items) in a world will despawn if the difficulty is set to peaceful, regardless as to where the player is positioned in the world.
In multiplayer, despawning does not occur while there are no players in the game.
A monster which has been named with a name tag will not despawn. However, one created from a renamed spawn egg will despawn as normal.
If a monster is holding any items or wearing any armor that was given by a player or picked up from the ground, it will not despawn.
Best Answer
Slimes only can spawn in a swamp if the swamp is between Y-levels 50 and 70. In addition, slimes will also only spawn if the light level is at most 7.
To be more accurate:
Slimes can actually be rather rare if the random number generator does not like you.
In addition, slimes follow all normal mob spawning rules. They will only spawn if you are within 16 to 144 blocks from a "valid" area.