The definition of marriage has historically been a power reserved to the individual states, which is why every big gay rights movement has been on the state level. However, the federal government defines 'marriage' for its own statutes and laws.
The most pertinent piece of federal legislation is the Defense of Marriage Act, passed in 1996 which basically said the federal government will not recognize same-sex marriages even if they are legal in the state in which the couple was married. It is a terrible and disgusting piece of legislation and the homosexual community as a whole felt betrayed by Bill Clinton when he signed it into law. However, there is hope. President Barack Obama has made mention that he would like to repeal DOMA, which would be awesome in so many ways. I hope he can pull it off.