No, this should not affect your chances.
First off, the background check for a government clearance is pretty in-depth, and would likely only be happening after you are given a job offer. All of this information would be considered private, so the company interviewing you shouldn't know about your medications at all - only the government investigator would, and only after you told them. You going to the doctor will not automatically put you on a list somewhere.
Second, having a history of depression is not something that would disqualify you from getting a clearance. From Clearance Jobs:
If you have depression and/or anxiety, you’re in good company with countless other security clearance holders. You shouldn’t feel ashamed or stigmatized because of it.
Seeking out treatment for such a condition (or any mental health condition, for that matter) is NOT itself disqualifying for obtaining a security clearance. In fact, it is quite the opposite. Failure to obtain mental health care when needed can be viewed as evidence that you are in denial and/or lacking in judgment.
So please, don't delay going to the doctor because you are worried about getting a job. Interviews can be stressful, and you'll probably be more successful if you try to address your mental health before rather than after.
To address a question in the comments, the investigator will only request access to your medical records if your doctor says that they believe you have a condition that could impair your ability to protect classified information. Again, from Clearance Jobs
If a clinician answers ‘no’ to the the question ‘Does the person under investigation have a condition that could impair his or her judgement, reliability or ability to properly safeguard classified national security information,’ does the investigator request mental health records?
. . .
When the mental health practitioner(s) answer(s) “no” to the first question, there is no further investigation of this issue, unless the investigation surfaces contradictory information from some other record or personal source. When there is a “yes” to the first question, the applicant is usually required to complete an INV Form 16A, Specific Medical Release, which is used to obtain more detailed information regarding medication, other treatment, test results, and medical opinions regarding health, recovery and/or rehabilitation.
Here's another helpful link that goes over the actual questions about mental health you would encounter on the background check form. (h/t Joe Strazzere)