As will_is_myth stated, fianchetto is a way to develop your bishop, so basically depends on your taste for certain positions, the long range of the bishop on the big diagonal often has multifunctional purpose, like: set up a battery with the queen to aim at one or another flank of the board, make a strong fortress on your castled position that is flexible as much in defense and attack, support the protection of certain pieces covered in its diagonal, must mainly to influence the central squares that belong to its range of activity, the pawn structures that fit this concept are variable according to what your opponent plays so that's pretty much an individual preference to choose the fianchetto development or not, just like Bg5 may or not be played according to your strategy as commented previously; however sometimes the position asks you to develop your bishop in a certain way like when too many pawns are in the same squares as any of your bishops and it's difficult to develop such piece, then playing a fianchetto styled position is logically justified, here are some reference games that you can check for expanding this concept:
http://www.chessgames.com/perl/chessgame?gid=1044281 [Fischer using his fianchetto bishop to open a central file for his rook] ---
http://www.chessgames.com/perl/chessgame?gid=1069963 [Kasparov neutralizing an opponent's fianchettoed bishop with a fianchetto of his own] ---
http://www.chessgames.com/perl/chessgame?gid=1924138 [Kramnik wins a pawn with his fianchetto bishop to set preponderant activity for his pieces on central squares] --- And some more criteria on the use of the fianchetto
www.suffernchessclub.com/what-is-fianchetto-how-use/ I hope this provides some light on your question, have a good day