I'm pretty sure it comes from a courtroom, but in daily life people use it when there is no more to say on the matter especially if there point was just proven by someone else. Like if I were to call my brother clumsy and right at that moment he slips I could say I rest my case, because he has just proven my original claim.
Hope this helps =)