庙 is the general word for temple. More specific terms:
寺 (sì) for Buddhist temples (
少林寺),
观 (guàn) for Taoist temples,
庙 itself often refers to folk religion temples or ancestral halls. The phrase
跑了和尚跑不了庙 (the monk can run but the temple can't) means 'you can't escape forever.'