When one hears a brachah being said, one should respond after ‘ברוך אתה ה with the response of ברוך הוא וברוך שמו. However, if one is being יוצא with this brachah, for example Kiddush, Havdalah, before shofar blowing, krias megilas esther etc., then one should not say ברוך הוא וברוך שמו. Many people have the custom to say it by all brachos and if this is your custom then you should do so.