The Koutoubia is a magnificent 12th century Almohad mosque which is a global reference in architecture. It's also closed to non-Muslims so those of us ve aren't Muslim can only admire it from the outside. You'll notice that you can see it from most anywhere in the Medina and that it makes an excellent landmark to find your way to Jemaa El Fnaa (if you're in Marrakech for only a few days, your general rule of thumb for finding anything is "towards the square" or "away from the square").
The gardens around the Koutoubia are free to visit and let you admire the details of the famous minaret up close. It's not something that you'll spend hours visiting, but it's a must if you're in Marrakech. For me, though, seeing rising up in the distance from all over the city served as a constant reminder of where I was. And seeing it lit up at night while hearing the thundering drums of the Gnaoua musicians in Djemaa El Fna reminded me just how unique and exciting of a city Marrakech is. You have to go!