Hello Anupama,
Like Preetam Deshpande mentioned, this practice isn't legal & COULD land your company into legal trouble IF anyone goes to the court. Like many small IT companies in Andhra Pradesh who use this practice for retention, you also may not be paying any interest over the deducted amount--whatever be the quantum [I know some companies do pay interest]. Pl note that I am NOT disputing your intent here--only the 'HOW' part.
Like Pon suggested, try to include this within the Appointment Letter itself in the form of Retention Bonus. To explain, suppose a hiree wants a CTC of 6 L p.a., you can negotiate for 5.5 L for the monthly payout in form of salary AND 50K to be payable after 6 months or 1 year as Retention Bonus--whatever duration you have in mind. If the employee leaves before that period, then he/she stands to loose it--which will have to be mentioned clearly in the Offer/Appointment Letter. This is what Pon meant. That way, you neither have to make any deductions--complicating matters--and also maintain cordial relations with the employees. However, pl note that, like every step/measure in HR, this too has it's own set of downsides. You need to be on the watch around the time when the employee gets the Bonus--chances of an employee quitting AFTER taking the Bonus COULD be there. And, pl ensure the Bonus IS PAID WITHOUT DELAY as soon as it's due--many companies which have the Retention Bonus scheme delay this payment leading to unwarranted HR situations.
All said & done, there's no replacement for long-term Good HR Practices--which minimize such situations. But if you are looking for an ideal situation that NO employee will LEAVE, those days are gone.
All the Best.
Rgds,
TS