The reference to a church is made by Salarino during their conversation about Antonio's depressed mood. He says, in part:
Should I go to church
And see the holy edifice of stone,
Salarino and Salanio are concerned about their friend's sadness and are trying to establish what has put him in this melancholy mood.
'Holy edifice of stone' refers to a church building constructed of stone. The significance of Salarino's reference lies in the fact that seeing the church building which is secure and strong, would make him immediately reflect about the dangers his ship would have to face at sea. He is, in fact, drawing a contrast between the solidity and power of a rock and the fragile nature of a ship. Dangerous rocks would destroy a ship if it should, even gently, touch its sides. He would, at once have lost not only his ship but also his merchandise which, obviously, would drive him to tears.
The church building, made of stone, is also symbolic of the strength of one's faith. The church is a symbol of the power of belief. The ship, in this allusion is a fragile vessel and represents humanity. What Salarino is suggesting is that the church, symbol of a person's faith, is more powerful than anything and, therefore, offers protection. Anything or anyone who does not believe in its power can be utterly destroyed, just as a ship can be destroyed by dangerous rocks.
Furthermore, Salarino's metaphoric reference also stems from the fact that sailors would visit the church before leaving on an arduous journey, asking for guidance and protection. The church reminds him of the power of nature and how easily one can be destroyed by its force. He suggests that one can have something and then, suddenly, have nothing if one should veer off course and crash into dangerous rocks, both literally and metaphorically.