I can't tell you precise rule, but they are both correct. The meaning is a bit different though.
The first sentence (оставить) describes abstract situation, the general tendency of something.
Literally, the second sentence implies that the person to whom this sentence is said is actually going to perform the action. It omits the subject (ты), but you can add it there: "Если ты его оставишь...".
Although the second sentence could be used to tell general tendence too, but it has more realistic mood in it. You can use the second one when you are more sure because it has already happened before.
I hope I didn't confuse matters even further.