You can have a miscarriage at any time during pregnancy, but thankfully the risk goes way down after 12 weeks. :)
Dr told me that after you hear baby's heartbeat the chances drop significantly and then after 12 weeks it is down to less than 5%
Once you reach your second trimester it decreases substantially