If you are looking to just rename the Database without renaming the physical database file (.mdf) and log file (.ldf)
1. You can achieve that by using MS SQL Management Studio and renaming the database
2. Update the connectionstrings in the connectionString.config file in .../website/App_Config/ConnectionStrings.config file for the databases you just renamed. The connection strings are for the master, core, web, analytics databases.
If you are looking to rename the Database name and rename the physical database file (.mdf) and log file (.ldf)
1. Stop the corresponding sitecore site app_pool from IIS
2. Use SQL Management Studio to dettach the database first
3. Rename the physical database file (.mdf) and log file (.ldf)
4. Reattach the database using SQL Management Studio
5. If you want to rename the database - follow steps in scenario 1
I would recommend taking backup before performing any renaming.
Hope this helps.