Well that would depend on a few factors. Such as how long you have been doing it and how heavily you been doing it. Also if you had any sort of problem with ED before the weed.
Now it could take a month or less to notice any changes. Though talking to your doctor would also be a good idea. Be open with the doctor about what is going on so he can help you figure things out.
I have heard that weed can cause problems with erections. I don't know that there would be a "time" in which things return to normal. However, if after 30 days there were still a problem I'd be speaking to a doc about it!