I don't get this cloud mining

So let's say I buy 1TH/s, that's worth
BTC2.9 then I mine for 30 days. Then after that, I don't want to mine anymore.
Do I get my
BTC2.9 back plus my earnings from mining??
It varies by vendor, but in this case you are buying a 5 year mining contract.
After 5yrs, Do I get my
BTC2.9 back? Or will I only get my earnings from mining?
If I won't be getting my
BTC2.9 back, will I have something to resell, like a mining hardware?
Nope. It's just a mining contract. You pay them to use their equipment on your behalf at an agreed upon rate foran agreed upon amount of hashpower. They pay out the proceeds once a week to your wallet. You may or may not recover all that you spent, depending on difficulty, in a reasonable time frame.
Pretty normal stuff for a performance contract. To determine whether it's worth it to you or not, you have to do the calculations of physical hardware, money you have to invest, electricity costs, expected return vs. anticipated difficulty increases (I'd aim high on diff and low on return for the sake of safety in calculation) and make a choice. You are esentially renting their hardware for 5 years.