A recent post on the Retraction Watch blog–concerning a grad student retracting a sole-author paper when her advisor claimed ownership of her data–highlights the complicated nature of data ownership. This area is so complex that the only answer to the question of “who owns my data?” that I can provide is: it depends.
There are a lot of parties with an interest in your research data, not limited to: your funder, your institution, your boss/advisor, your collaborators, and you. Each of these entities may have a policy (explicit or not) on who has ownership of and who gets access to the data. My alma mater, for example, has a policy that establishes the university as the owner of the data but the PI as the steward of the data, meaning that PIs get to make most all of the decisions about data generated in their labs. Funders, on the other hand, may not exert ownership over your data but may instead require you to share it.
My best advice in this area is to assume that you don’t have ownership of your research data–especially if you are a grad student–until you look into your local policies. Even if you do all of the research, the entities who provide the equipment, laboratory space, and money may still lay claim to the data.