The name displayed when you send messages from the web browser version of Gmail is the one you picked when you first signed up - either for a Gmail address or a Google account.
Note: the second part of this tutorial also explains how to change your Google account name.
To change your name for Gmail, click on the gear icon (near top right), and choose "Settings".
Select the "Accounts and Import" tab at the top.
The third option, labeled "Send mail as", lets you add other "From" email accounts: click on the "edit info" link on the right - make sure that your popup blocker allows the new window to open.
Select the radio button next to the blank text field, and type your new display name:
Click Save Changes to apply; the next email you send will reflect your updated "From" name:
To change the name for your Google account, go to google.com and login if needed; then, click on your email address (shown near top right corner), and click on "Account".
Click on the "Edit" link next to the "Email" header in the next screen. When the "personal details" form loads, enter your new first name and/or last name; then scroll down, and click Save!