Following math works for perspective projection.
Height of zNear, another words it’s height of near plane:
float H_near = 2*near*tan(fovy/2);
And the same for zFar, to get height of far plane:
float H_far = 2*far*tan(fovy/2);
To get width, just multiple on aspect ratio of your screen.