Go to the Settings tab for your repository.
Add your key and make sure you toggle write access.
You're done :)
For Bitbucket, you'll need to add the key to your profile instead of a repository for it to have write access. You can do this from your profile, a link for which you'll find at the bottom left of your screen when logged in:
Then, add a new key to your profile: