The relationship described in the scenario is that the new number of pens \( y \) is equal to the original number of pens \( x \) plus 2 extra pens. This can be expressed with the equation:
\[ y = x + 2 \]
Therefore, the correct answer is:
B. \( y = x + 2 \)