user16771: I would like to know why playing d5 in these two positions is useful for me (Black).



user15223: In addition to the other answers, I want to point out that closing your Bishop's activity isn't important here:

Your bishop isn't active. Sure it's got an open diagonal, but it's not generating any threats. In the first position, you could play Bxf3 but then White would just recapture with the Queen and you've not achieved anything. In the second position, it's not like you are able to mount a kingside attack. The Bishop attacking g2 does absolutely nothing then.
Your bishop's activity is "low quality". White is easily ready to counter the activity. If White gets to play e4 then your bishop effectively becomes useless even though you haven't blocked the diagonal.

In other words, you don't actually lose much by playing d5. 

user12873: Other than controlling the e4-square (as noted by PhishMaster), there are some additional reasons ...d5 could be useful, which I'll list below. But even if these reasons didn't exist, ...d5 would still be best since controlling e4 is necessary.
1) It gives Black's queen more space.
2) It controls the c4-square, potentially stopping White from playing Nc4 (and discouraging c4). These moves aren't dangerous now, but they could be later on. For example, if you want to play a move like ...Bd6 at some point, avoiding Nc4 would be nice.
3) In general, it gives Black more influence in the centre, simply by virtue of pushing a pawn to d5.
You're right that the move blocks in the b7-bishop, but in a way it also increases the piece's strength. Now the bishop's control of e4 actually means something, since Black has a good chance to fight for it. 
But note that if you want to exchange off the bishop, this could be done with ...a5 + ...Ba6 (eliminating White's dangerous d3-bishop); notice how without a pawn on d5, White could easily meet this with c4. In addition, another plan for you after ...d5 is ...Nce8-...Nd6, further clamping down on e4. Putting your knights on f6 and d6 is an important theme against the Stonewall structure.

user19877: You do not have enough control of e4, and if white gets to play e4-e5 here, your king is a goner. It is an absolute must here to stop that plan, and the only way to do it is d5. Making your Bb7 bad for now pales in comparison to letting your king get mated, or loss of significant material, which will happen after e4-e5.

16771: <p>I would like to know why playing d5 in these two positions is useful for me (Black).
<a href="https://i.stack.imgur.com/jfKD5.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/jfKD5.jpg" alt="enter image description here"></a></p>

<p><a href="https://i.stack.imgur.com/beZFB.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/beZFB.jpg" alt="enter image description here"></a></p>
 15223: <p>In addition to the other answers, I want to point out that closing your Bishop's activity isn't important here:</p>

<ol>
<li><p>Your bishop isn't active. Sure it's got an open diagonal, but it's not generating any threats. In the first position, you could play Bxf3 but then White would just recapture with the Queen and you've not achieved anything. In the second position, it's not like you are able to mount a kingside attack. The Bishop attacking g2 does absolutely nothing then.</p></li>
<li><p>Your bishop's activity is "low quality". White is easily ready to counter the activity. If White gets to play e4 then your bishop effectively becomes useless even though you haven't blocked the diagonal.</p></li>
</ol>

<p>In other words, you don't actually lose much by playing d5. </p>
 12873: <p>Other than controlling the e4-square (as noted by PhishMaster), there are some additional reasons ...d5 could be useful, which I'll list below. But even if these reasons didn't exist, ...d5 would still be best since controlling e4 is necessary.</p>

<p>1) It gives Black's queen more space.</p>

<p>2) It controls the c4-square, potentially stopping White from playing Nc4 (and discouraging c4). These moves aren't dangerous now, but they could be later on. For example, if you want to play a move like ...Bd6 at some point, avoiding Nc4 would be nice.</p>

<p>3) In general, it gives Black more influence in the centre, simply by virtue of pushing a pawn to d5.</p>

<p>You're right that the move blocks in the b7-bishop, but in a way it also increases the piece's strength. Now the bishop's control of e4 actually means something, since Black has a good chance to fight for it. </p>

<p>But note that if you want to exchange off the bishop, this could be done with ...a5 + ...Ba6 (eliminating White's dangerous d3-bishop); notice how without a pawn on d5, White could easily meet this with c4. In addition, another plan for you after ...d5 is ...Nce8-...Nd6, further clamping down on e4. Putting your knights on f6 and d6 is an important theme against the Stonewall structure.</p>
 19877: <p>You do not have enough control of e4, and if white gets to play e4-e5 here, your king is a goner. It is an absolute must here to stop that plan, and the only way to do it is d5. Making your Bb7 bad for now pales in comparison to letting your king get mated, or loss of significant material, which will happen after e4-e5.</p>
