Minecraft wiki entry for Slime, associated text: If no target is found, the slime waits 10 to 30 ticks (1⁄2 to 1 1⁄2 seconds). Then it changes direction by a random amount up to 57.26° (1 radian) left or right, jumps forward, and repeats the process.
If a target is found, the delay before jumping is 1⁄3 as long (3 to 10 ticks), and the slime's direction is set directly toward the target before jumping.