This Graphical method will only work for Business, Professional, Enterprise, and Ultimate versions of Windows 7 and Vista.
Open Local Security Policy from Control Pane -> Administrative Tools.
Expand Account Policies on the left and select Account Lockout Policy..
Now, double-click on the Account lockout threshold.
A dialog box will appear. In this dialog, enter the maximum number of trails you want to allow. For example, if you enter 4, so your account will be automatically locked after 4 unsuccessful attempts. Click Ok.
One more window will appear asking for Account lockout duration and the length of time to Reset account lockout counter. If you want to keep them to default value of 30 minutes, Click Ok. Otherwise you can change these values by double-clicking them.