Is there a cost to running the NewYork Stock Exchange? Does it affect the price of stocks sold on the exchange? Is there a cost to running the New York Stock Exchange? For example electricity costs, management costs,  rents on the building(s).  How do these costs (if any)  affect the price of stocks sold on the exchange?
Yes, there's a cost to running the New York Stock Exchange. There's the premises, utility bills, staff, systems, and so on.

Yes, this affects the price of stocks on the exchange. The exchange recoups its fees, ultimately, from the companies listed on it, pushing up their costs.

However, for pretty much all companies listed on it, the stock exchange fees are a tiny part of their overall costs. Which means that the impact on the stock prices is pretty much negligible.