An exchange is nothing more than a marketplace for buyers and sellers. They could in theory not buy the coins till you wanted to cash out, that would be a Ponzi scheme. That happened recently with a small exchange site. See this article:
http://www.wantchinatimes.com/news-subclass-cnt.aspx?id=2013...
In general the way it works for a non ponzi scheme setup is that another user on MtGox is selling, and you are buying, so essentially if you buy, your account balance of coins goes up and at the same time the seller's balance goes down. Keep in mind though, no actual bitcoins moves because MtGox is holding them all in their account. It's exactly like what happens when you transfer money to someone who banks at the same bank as you. The money moves from one account to the other on the ledger, but really no money moved at all.