if you are using MSSQL open up enterprise manager, (Local) go down to management, then database maintenance plans,(right click, new maintenance plan) and follow the wizard there, along the wizard there is an option for how many backups to keep, as well as other helpful options. and also how frequently to perform the plan, ect