At CMN, stay airside—distance and security processing make short city trips risky.
A 3-6 hour layover in Casablanca works well thanks to the direct airport train. The ONCF train from the airport station runs every 30 minutes to Casa Port (central station) in 35 minutes for 45 MAD ($4.50). From the station, Hassan II Mosque is 20 minutes walk or a short taxi. The mosque exterior is free to view; guided interior tours run in the mornings. Head back 75 minutes before your flight using the same train.
Six to ten hours lets you combine the mosque with the city's distinctive Art Deco architecture. After Hassan II Mosque, walk the corniche waterfront for 30 minutes. The old medina (20 min taxi from the station) is smaller and less intense than Marrakech - a relaxed introduction to Moroccan market culture. The Habous neighborhood (New Medina) has excellent traditional pastry shops and a weekly craft market. For food: Casablanca's Atlantic seafood is outstanding - try grilled sardines at a restaurant on the corniche or head to the Marche Central fish market and pick your own. Return via train from Casa Port.
With 10+ hours, combine Casablanca with Mohammed V Square and the Hassan II Mosque on a walking circuit. The Art Deco buildings around the square (built during the French Protectorate 1912-1956) are some of the finest in Africa. Rick's Cafe (yes, it exists - it's a replica inspired by Casablanca the film) is a tourist attraction but serves decent food. The Ma'arif neighborhood has upscale restaurants and the local expat social scene. Casa's coastal suburb of Ain Diab has beach clubs if you want sand and Atlantic swimming. The day trip to Rabat (45 min by train, $5) is worth it for the Chellah necropolis and the Kasbah of the Udayas.