If you are performing these operation on the blockchain then yes. A contract = on the blockchain = the miners have to mine it and therefore you have to pay for those computations.
For this reason loops without limits are dangerous and should not be used, as you could accidentally have an endless loop and therefore an infinite amount of gas. Luckily, there is a global gas limit so your contract will fail (but the funds in the contract may be stuck, depending on the circumstances).
FYI, a standard transaction (one with no data) currently costs 21000 gas. If you just want to send a short message in the data, it would be maybe 22000 gas. But as the amount of data you send and the items in the contract increase, so do the transaction fees.
Regardless, unless you have a super crazy contract, these fees will be less that what traditional banking changes for a purchase / transaction ($0.10 + 3% on average). If you have said crazy contract, you should think about the design of the contract and potentially break it into pieces or change some computations to not be on the chain.