Memory involves three steps: Encoding what you learned, Storing it and then Retrieving the information when you need it. At any one of these three points problems can occur.
Now, it is true that anxiety and depression both interfere with memory retention, especially anxiety as when we are anxious our ability to focus and retain is greatly impacted. But at your age this would not be typical to the level that you are experiencing it.
You could have an undiagnosed amnesic disorder. This is an issue where, in an adult, the inability to learn information occurs. It often appears as a memory issue and fortunately can be tested and identified through the services of a psychologist who can rule out this problem for you. If you have this issue, a treatment protocol similar to those used with people with learning disabilities is created.
However, a real key may be the medications you have been taking. ACH, a neurotransmitter created by your brain/nerve cells is responsible for memory retention. When ACH is blocked or interfered with, often due to other neurotransmitters like serotonin being enhanced by other medications, memory issues can result. (For example, the medication, Benedryl will block a portion of your bodies ACH. If you take Benedryl and then try to take a test the next day in school you will find it very difficult as ACH has been blocked by the drug and memory impairment occurs.)
It sounds like you have been shuffled around a lot by many doctors. My recommendation: See an endocrinologist to rule out hormonal, (estrogen is notorious for memory impairments in hyper and hypo amounts) and/or thyroid conditions. This type of doctor can often find things that the others cannot.
Hang in there. You probably have a biochemical issue that is causing this which originates either with your own biochemistry or the drugs. Rule out your own biochemistry first, then work on the drug source themselves by seeing one physician who can work through tis with you over time.
And, only 50% or less of patients with depression or anxiety get better on medications alone. Counseling has been shown to improve depression by 80% or more in many cases. Steven