When you refrigerate Yogurt it will last up to 7 days and sometimes a bit longer although the longer you keep the Yogurt the less fresh it becomes but it's still safe to eat after 7 days as long as it's been kept refrigerated.
Usually the opened or unopened Yogurt can last as long as 2 weeks and if you notice any mold in the yogurt then it is bad and should be thrown out.
You can freeze Yogurt to keep it longer but if refrigerating Yogurt it's best to eat it within 1 to 2 weeks for the best tasting and freshness of the Yogurt.