If you activated a Google Account on the phone, after 5 unsuccessful attempts you'll be prompted to enter a phrase to verify that you're attempting to unlock the phone. Then:
If you forgot your unlock pattern, you can tap Forgot pattern? (at the bottom of the screen). You can sign in to your Google Account or enter your Backup PIN to regain access to your phone.
If a Google Account wasn't activated on the phone before setting the lock (or you also forgot your Backup PIN), the only way to regain access to the phone is to perform a Hard Reset which erases all of your user data.
If you perform a Hard Reset, all user apps and user data will be deleted.