To prevent a duplicate record:

Ensure that the name, address and contact information are entered to match the constituent record. 

OR

In Web, Web Payment Settings, mark the Enable Registration checkbox to allow patrons to register online.  
Note: This creates a link between the web form purchase and the constituent record by allowing users to associate passwords with their email addresses during checkout. When users log in to access forms, the program inserts data from the records in your database.

If a duplicate record has already been created, either delete the duplicate or merge the constituent records together.

Check out this video on the constituent matching settings for web forms: