I have the problem of leaving alkaline batteries in various devices, and have lost some I could not clean with vinegar. If I don't use the device, I take the batteries out. But a lot of devices are used frequently. To avoid leakages, how often should the batteries be checked, and how should they be checked?
You don't need to check devices used frequently
Because you will soon notice that the device has gone inoperative, and will simply change the batteries at that point. What gets 'ya is devices you rarely use.
One option is to use rechargeable batteries in those rarely used devices, which is to say NiCd or NiMH batteries. They will still discharge, however they won't be damaged by doing so. In fact, NiCds and NiMH's normally self-discharge over time, so if left in a drawer for a year, they will be fully discharged within 90 days and spend 275 days in a fully discharged state, without taking any damage.
Obviously after 90 days the device will not be usable and you'll have to take the batteries out and charge them; but you use them rarely anyway.
If you need to have your rarely-used devices "ready and good to go", then my advice is to use primary cells (non-rechargeable), and change batteries annually. Don't throw out the old batteries; just demote them to frequently used appliances.
Alkaline batteries should only leak once they go flat or are physically damaged. Basic info here. More info here. So the trick is to remove batteries as soon as they are flat or almost flat (below ~0.9V per cell). If you can't tell when they're flat (i.e. no multi-meter available) it is best to follow the advice of some manufacturers who recommend removing batteries whenever not in use.
Another alternative would be to use the Lithium-Iron Disulfide type as these don't leak or dry out like alkaline cells, and they have much better shelf life and temperature tolerance and roughly double the energy density, don't produce hydrogen in sealed enclosures (like dive lights) when abused (so consequently your dive lights won't explode). They are made by Energizer under the "Energizer Lithium" label typically, or by GP in China (equally good in my opinion). They have higher initial voltage (~1.8V) than alkalines typically.
A company I used to work for shipped around 300000 of these per annum with almost no problems, as compared to alkalines which caused countless headaches for support staff.
This is opinion, so I'd be interested if anyone has a more factual answer.
The problem is that battery manufacturers don't admit to their cells leaking. They say they do not leak, and don't say things like "Won't leak for at least 5 years!". So, when to check comes down to "how important is the device". If it's very important, use a big name brand battery and simply replace the batteries once a year. You can't tell that a battery is about to leak, so the only way to prevent it is to cycle them out.
Use the time change or New Years or some big even to remind yourself. Regardless of how much is left in the batteries, replace them. You can have a box for the partially depleted batteries and you can re-use them in high-drain devices if you don't want to waste any power.
Leaking is very unpredictable. I've seen it happen in less than a year with generic batteries and I've also found a 15 year old CD player with good batteries that still powered on the display!
"I could not clean with vinegar" - yeah, I bet not; that's not casuistic enough nor even on my list: spray can of contact cleaner, rubber eraser, or sandpaper... after cutting the excess crud off with a knife or scraping it with a flathead - try not to damage the plating, but if you have to take it down to bare copper, so be it.
'I opened a device right away after it had quit working, and the battery had already leaked.' - that's going to happen once in a while. See above. The only thing I check batteries for is charge. [insert rant about how you're supposed to remove them, which none of us do]. If they're dead and leaked, it's time to change them and clean the contacts; simple as that.