Gunbot handles exchange fees by allowing users to set the average expected fee level when connecting to a cryptocurrency exchange. This information is used to calculate the unit cost of assets held, ensuring that profit targets are consistently set above the fee level to maintain the profitability of trades.