While building your application and installing it directly from studio, studio will use the debug key.But while releasing the app, the apk has to be signed with release key instead of debug key.The Android SDK tools generate this release certificate when you do a release build.
So for generating the map key, if you are in development phase, you can use debug key to generate map key. But when you release the app, you have to obtain new map key using the release key and replace that in your manifest file.
Regarding signing your app, refer this link.
Your application needs an API key to access the Google Maps servers.
The type of key you need is a Key for Android applications. The key is
free. You can use it with any of your applications that call the
Google Maps Android API v2, and it supports an unlimited number of
users.
Choose one of the following ways to get your API key:
The fast, easy way: Use the link provided in the google_maps_api.xml file that Android Studio created for you:
Copy the link provided in the google_maps_api.xml file and paste it
into your browser. The link takes you to the Google Developers Console
and supplies information via URL parameters, thus reducing the manual
input required from you.
Follow the instructions to create a new project on the console or
select an existing project.
Create an Android API key for your console project.
Copy the resulting API key, go back to Android Studio, and paste the
API key into the element in the google_maps_api.xml file.
A slightly less fast way: Use the credentials provided in the google_maps_api.xml file that Android Studio created for you:
Copy the credentials provided in the google_maps_api.xml file.
Go to the Google Developers Console in your browser.
Use the copied credentials to add your app to an existing API key or
to create a new API key. For more details, see the complete
process.
The full process for getting an API key: If neither of the above options works for your situation, follow the complete process.
Refer this link for more details