It is forbidden to “shmooze” stam idle talk (to have a friendly conversation) in a Shul or Beis Medrash, even to catch up on news. Even if it is purposeful (but not necessarily a mitzvah).
See OC 151:1 with MB (especially s.k. # 2)
See also Be’er haGolah YD # 334, at the very end…(we don’t want to scare you, but that’s Hilchos Niduiy V’Cherem…)
This issur is even when it is NOT davening time-this is purely due to the kedushas mokom.
There is another issur to talk during davening .Sometimes it is objectively ossur to be mafsik (to interrupt) the davening (e.g, you are in the middle of pesukei d’zimrah)…This includes during chazzaras haShatz.
And sometimes it is because it is seen as a bizayon davening, and shows that your attitude to davening to HaShem is severely lacking. And this would hold true, even when davening at home, privately.
Many times people wonder why their Tefillos are seemingly not answered…h’mmmmmm…
See Taz 55:4, who uses very sharp words . If he’d be a Rav of a Kehillah, no question he’d be fired, forthwith.
If one is disturbing others —See RamBam Hilchos Teshuvah 4:1 (see number one there) .
One may greet another person, ask how he is, but then the “conversation” must cease. (This is true when dealing with the issur of the kedushas mokom. When the other issurim are involved, a shayloh must be asked.)
If a mitzvah is being discussed, generally it is muttar- again, ONLY when the issur is the kedushas mokom or the attitudinal one.
If the conversation (beyond the bare-bones greeting described above ) IS the mitzvah (cheering someone up ), as sometimes is the case, a shayloh must be asked. And again, this is ONLY when confronted with the issur of kedushas mokom, and the attitudinal one.
Rabbosaiy: Read this well, study some sources, so that you will know what is being dealt with.