I am travelling From Canada to KSA Via Turkey- Do I need a visa to visit the city during my layover hours? If Yes- Should I apply for it online or Can I just get it at the airport?
Presuming you are a Canadian citizen you will require an "e-visa" to enter Turkey. This can be applied for from the Turkish e-visa site, and generally only takes a few minutes to apply for and is normally issued immediately.
The cost of this visa depends on the country of citizenship, but for a Canadian is US$60.