Depends on your sponsor. But technically, they can keep you here and deny you exit permits for as long as you want. It's not common, but it's not unheard of.

You need to feel that you can 100% trust your employer, and if you don't, then ask yourself if you are making the right move in coming to Qatar.