The first is formal, the second is informal.
The verb "to be" is a special kind of verb called a cupola; it doesn't have an object, it has a complement. But if the complement is a pronoun, should it be subjective ("I") or objective ("me").
Those who say it should be subjective argue that this is logically correct, because the subject and the complement are the same thing, therefore they ought to be the same "case", much as it would be in Latin. Those who say it should be objective say that that's nonsense because "you" and "I/me" are not actually the same thing, and they say that English should be a bit more like French (which has special pronouns to use as the complement).
The way linguistic history has happened, those who argue for a more authoritarian approach to grammar are on the "subjective" side of the argument. For that reason, "if you were I" is considered for formal than "if you were me".
- For Teachers