Both are grammatically correct and convey the same meaning. These would usually be spoken in a rhetorical sense to yourself. If you wanted to ask someone if they know where your keys are you would say, "Do you know where my keys are?" or "Do you know where I left my keys?" For example, if I am rushing out of the house and can't find my keys, I usually say to myself, "Where have I left my keys??" or "Where did I leave my keys?" as rhetorical questions. They are not meant to be answered by anyone - just a statement to myself to indicate to others that I have lost them and cannot find them.
I hope this is helpful!