You should see a doctor. You could have a neurological problem. I'm fairly certain that some forms of epilepsy can cause memory loss during and after seizures. You also would want to rule out anything super-scary like a brain tumor (Don't worry because this is very unlikely, especially if you don't have other symptoms.)
Possible psychiatric culprits include dissociative disorders and depression. Unless you experienced childhood trauma, you probably do not have a dissociative disorder. Depression often affects cognitive processes (especially memory and attention), so if you have been feeling particularly unmotivated, fatigued, down, worthless, etc., it is a possibility. You definitely should seek medical advice. Good luck, and feel better!