Upvote:1
If you are traveling with Emirates, check at their transfer desk - they will arrange the visa for you. Otherwise, for 12 hour transit you can get a transit visa at the counter right before immigration, and visit the city.
However, you may not even need a visa depending on your nationality. It is best to check with the UAE immigration. Emirates provides a handy guide which lists those nationalities that do not need a visa or can get a visa on arrival.
From the airport, you can take the metro (light rail) or the cab. There are luggage storage lockers available at the metro station; and also at Dubai Mall.
Plan to leave quite early for your departure as traffic in Dubai can get thick in the evenings.