Slimes can spawn in swamps and mangrove swamps between the altitudes of Y=51 and Y=69 (inclusive) when the provided light level is 7 or less. They spawn most often on a full moon, and never on a new moon.