The calculation will depend on whether the chemical of interest predominantly behaves as an acid or a base, whether it's strong or weak, and whether it's monoprotic or polyprotic.
Concentrated pure aqueous solutions of a chemical with a pH below 7 are typically acids, while concentrated pure aqueous solutions of a chemical with a pH above 7 are typically bases.
Assuming the chemical "B" is a strong monoprotic base and water autoionization is negligible, the moles of hydroxide ions $\ce{OH-}$ of a solution with volume $V_B$, before dilution are:
$$n_{\ce{OH-}}=10^{\pu{-pOH_o}}\;V_B$$
After diluting by adding a certain volume $V_w$ of pure water:
$$C_{\ce{OH-}}=10^{\pu{-pOH_o}}\frac{V_B}{V_B+V_w}$$
Taking the negative base 10 logarithm on both sides:
$$\pu{-log}\;C_{\ce{OH-}}=\pu{-log}\;(10^{\pu{-pOH_o}})-\pu{log}\;\left(\frac{V_B}{V_B+V_w}\right)$$
Which is equivalent to:
$$\pu{pOH}=\pu{pOH_o}-\pu{log}\;\left(\frac{V_B}{V_B+V_w}\right)$$
Or in terms of pH:
$$14-\pu{pH}=14-\pu{pH_o}-\pu{log}\;\left(\frac{V_B}{V_B+V_w}\right)$$
Solving for pH:
$$\pmb{\pu{pH}=\pu{pH_o}+\pu{log}\;\left(\frac{V_B}{V_B+V_w}\right)\quad\text{(for SMB)}}$$
For a strong monoprotic acid, the derivation is analogous, except no conversion between $\pu{pH}$ and $\pu{pOH}$ is necessary, so the resulting expression is:
$$\pmb{\pu{pH}=\pu{pH_o}+\pu{log}\;\left(\frac{V_A+V_w}{V_A}\right)\quad\text{(for SMA)}}$$
Where in both cases, pH represents the final value (after dilution), while $\pu{pH_o}$ represents the initial value (before dilution).
For either case, adding a very high volume of water will make the pH of the solution asymptotically approach the value of 7, but it will never reach it.
Some examples of monoprotic strong bases are sodium hydroxide ($\ce{NaOH}$) and potassium hydroxide ($\ce{KOH}$).
Some examples of monoprotic strong acids are hydrochloric acid ($\ce{HCl}$) and hydrobromic acid ($\ce{HBr}$).
For a weak monoprotic acid, the calculation is as follows:
The initial concentration of the acid solution can be set in terms of $x$:
$$C_{Ao}=\frac{x^2}{K_a}+x=x\left(\frac{x}{K_a}+1\right)$$
Which means the total moles of acid before dilution is:
$$n_{Ao}=C_{Ao}V_A=x\left(\frac{x}{K_a}+1\right)V_A$$
At equilibrium, before dilution, the equilibrium constant expression in terms of moles is:
$$K_{n_o}=K_a\;V_A=\frac{y^2}{n_{Ao}-y}$$
At equilibrium, after dilution, the equilibrium constant expression in terms of moles is:
$$K_{n}=K_a\;(V_A+V_w)=\frac{(y+z)^2}{n_{Ao}-(y+z)}$$
Substituting $n_{Ao}$:
$$K_a\;(V_A+V_w)=\frac{(y+z)^2}{x\left(\frac{x}{K_a}+1\right)V_A-(y+z)}$$
Where:
$$x=10^{-\pu{pH_o}}$$
$$y+z=10^{-\pu{pH}}\;(V_A+V_w)$$
Substituting above and simplifying:
$$K_a=\frac{10^{-\pu{pH}}}{10^{\pu{pH-pH_o}}\left(\frac{10^{-\pu{pH_o}}}{K_a}+1\right)\frac{V_A}{V_A+V_w}-1}$$
Solving for pH:
$$\pu{pH}=\pu{log}\left(\frac{K_a+\sqrt{K_a^2+4\times10^{-\pu{pH_o}}\;(10^{-\pu{pH_o}}+K_a)\;\frac{V_A}{V_A+V_w}}}{2\times10^{-\pu{pH_o}}\;(10^{-\pu{pH_o}}+K_a)\;\frac{V_A}{V_A+V_w}}\right)$$
Conversely, for a weak monoprotic base:
$$K_b=\frac{10^{\pu{pH}-14}}{10^{\pu{pH_o-pH}}\left(\frac{10^{\pu{pH_o}-14}}{K_b}+1\right)\frac{V_B}{V_B+V_w}-1}$$
Solving for pH:
$$\pu{pH}=14-\pu{log}\left(\frac{K_b+\sqrt{K_b^2+4\times10^{\pu{pH_o}-14}\;(10^{\pu{pH_o}-14}+K_b)\;\frac{V_B}{V_B+V_w}}}{2\times10^{\pu{pH_o}-14}\;(10^{\pu{pH_o}-14}+K_b)\;\frac{V_B}{V_B+V_w}}\right)$$
For simplicity, we can define:
$$\beta_A=2\times10^{-\pu{pH_o}}\;(10^{-\pu{pH_o}}+K_a)\;\frac{V_A}{V_A+V_w}$$
$$\beta_B=2\times10^{\pu{pH_o}-14}\;(10^{\pu{pH_o}-14}+K_b)\;\frac{V_B}{V_B+V_w}$$
So the final expressions become:
$$\pmb{\pu{pH}=\pu{log}\left(\frac{K_a+\sqrt{K_a^2+2\beta_A}}{\beta_A}\right)\quad\text{(for WMA)}}$$
$$\pmb{\pu{pH}=14-\pu{log}\left(\frac{K_b+\sqrt{K_b^2+2\beta_B}}{\beta_B}\right)\quad\text{(for WMB)}}$$
An example of a weak monoprotic acid is acetic acid ($\ce{CH3COOH}$).
An example of a weak monoprotic base is ammonia ($\ce{NH3}$).
The calculation for polyprotic acids and bases is significantly more complex.
As a final note, all volumes need to be in liters (L), and the dissociation constants $K_a$ and $K_b$ are dimensionless.