I was there twice first time was for nine hours and was too dangerous to leave the airport (due to major riots in taking square) , so I payed for lounge access
and lounged.
My second time I had a seventeen hour stopover, davened in the airport early morning and took the bus into town. Ended up paying for the hop on hop off bus to be able to catch as much as possible.
I have heard that for stopovers longer than five hours on Turkish they offer a tour into Istanbul which would be a great alternative, because big groups are inadvertently safer. (the tourist visa costed $20 at a desk in the airport value for three months)