Is it that when you generate a bitcoin address it is assigned/locked to an exchange?
The reason for the difference in price is because each exchange is a closed system, meaning that the sellers and buyers have moved their funds onto a particular exchange, and not the another. If I'm buying all of my bitcoins on Mt. Gox then I will look for sellers on Mt. Gox because that is where my funds are. I wouldn't even bother looking at CampBX because I don't have the funds there and no way to purchase. So the sellers on each exchange are going to get whatever that market bears.
Hopefully, someday we will see a link opened up between the exchanges so that you can put your funds to buy on one exchange but buy from the overall worldwide pool, even if the BTC exists on a different exchange and vice versa. Doing this would give a lot of strength to Bitcoin as the Mt. Gox - single point of failure, problem would be solved.
Because if it isn't so then one may buy bitcoins from an exchange and sell it to another which offers a higher price within minutes.
I am confused how does it work??
This is called arbitrage. Arbitrage is certainly possible but it just isn't as easy as it sounds. In order to do this you must have funds on each exchange you want to arbitrage between. This is because otherwise you will have to move funds, whether old money or BTC between the exchanges. If you're moving BTC from one exchange to the other, that could take as much as 10 minutes for the block to be verified and usable on the exchange. The price could fluctuate before you're able to take advantage of the difference. If you're moving other currencies, i.e. the USD, then it can be rather difficult to quickly (and inexpensively) move funds back and forth.