I want to buy an Iphone off ebay to use with straight talk, what do I need to know?

Never had a smartphone and need some help here…
I want to buy an iphone, 5s if possible but more likely a 5 or 5c because I don't want to pay more than $300. From what I know, I need to get an unlocked GSM phone which means an ATT or Tmobile phone. I do not have tmobile service in my area, does that mean a tmobile iphone would not work on straight talk in my area?

What is an icloud lock and how does it work? Why would you have to pay icloud to get it unlocked and what does it have to do with cellular service?

If straight talk service doesn't cut it, can I switch back to another provider? Am I limited to certain providers?

Anything else I need to know about buying an iphone off ebay or craigslist?

Please help me with each of these questions, 5 stars comin' to ya.

I do not know?

Needs clean IMEI serial number number. Confirms phone was not reported to a carrier as lost/stolen/unpaid. Check that here:
http://myimeichecker.com/
If it's bad, move on. It's a scam and it's stolen. Carriers and Apple will not get involved in your purchase and honestly don't care.
Great if it's unlocked so you can use on GSM or CDMA carriers. Gives you more options for your area.
iCloud is a great feature for Facetime and iMessage but it's also party of 'Find My iPhone' security. If a previous iCloud account is on the phone and not removed and you can't get the former owner to remove remotely or give you the password, run, don't walk away it'll be worthless and can't be used. See these.

How many gigabytes? Any previous repairs? Any extended Applecare warranty?
See Straight Talk's coverage for your area. If there isn't much move on--plenty of options for prepay out there. Best luck.