I only have 2 and a half hours in Istanbul, I was wondering if I can go see the Blue mosque and the Hagia Sophia just to take a couple of pictures and head back. Is this possible? Will I be able to see both places? Will I be able to leave the airport? What's the best way to do this if possible? I have US and Bosnian passports. Do I need a visa? Sorry I don't travel a lot and want to see as much as I can:)
No, you can not.
THY (Turkish Airlines) give their passengers free tours of the city if your layover is long enough. 2.5 hours, by a long shot, is not long enough of a layover to get to the centre of the city.
Depending on how much time you have after getting off your plane, and depending on how busy passport control is, a very good metro line connects the airport with the city. Even just two stops away from the airport, you can find several local restaurants and cafes that are cheap and good. (I spent a short night there, on an eight hour layover, not too long ago.)
However, 2.5 hours is so short I wouldn't risk it.
I once had a ~16 hour layover in Ataturk and took the exact same route to the city.
Istanbul is a huge and crowded city and it could take hours just to move from one place to another; Ataturk Airport is even more congested than the city. Unless you want to achieve a mission impossible badge it's not logical to go to the city in 2.5 hours! In my opinion you'd need at least 10 hours to do so.
Regarding the visa requirements, I guess you could enter with your Bosnian passport without any need for a visa.