On the last 24th of April I had the chance to lay over in Istanbul for 6 hours, and I have proofed myself that it is possible to go to the city to the Hagia Sophia Cathedral and the Blue Mosque and still make it for my flight.
Once you arrive to the new Internatioanl Istanbul Airport, all you have to do is to go to the bus terminal (one floor down from the arrival terminal) and take the bus nr.20, which last stop is Hagia Sophia (bus it cost 18 turkish lira per way). It takes one hour (estimate 90 minutes in case of traffic) to get to this last bus stop. Once there you are right in the hot spot and you have the Hagia Sophia right in front to the Blue Mosque, so pick one of them, visit it, and then go to the other one. Hagia Sophia ticket cost 60 turkish lira, and the Blue Mosque is free of charge.