If your periods are longer than 35-40 days, it is possible that you are not ovulating regularly.
As the pregnancy
test is negative, your doctor has given you something to bring on your periods.
After that, if you want to conceive, you may need some help with ovulation, hence the pills.
Just follow your doctor's advice, and if you feel something is not clear feel free to ask. Your doctor will probably monitor you with scans to see if you are ovulating and advice you when is the best time to conceive.
Hope that helps.