How do I get the world coordinates of corners of far clip panel of camera in a script?

I have undersood how to get the coordinates of the center of this rectangle. Also I know that ratio of its sides can be found using Camera.pixelRect. Property “Field of view” also changes the size (but not the ratio of the sides) of this rectangle. So how to get the length of the rectangle’s sides in units?

The rectangle size depends on the field of view angle and far clip distance. To know how big the frustum is at a given distance, you need to use trigonometry:

var visibleHeight = Mathf.Tan(0.5f * cam.fieldOfView * Mathf.Deg2Rad) * distance * 2f;

This will give you the height of the rectangle. Just multiply it with cam.aspect to get its width.

If you’re only interested in the width / height of the far clipping plane, what Adrian wrote should be enough. However if you’re actually looking for getting the worldspace positions of the corners (as the title states) you can simply use ViewportToWorldPoint. The input x and y coordinates should be the desired corner in viewport coordinates, so the 4 corners are
(0,0) - Bottom left
(1,0) - Bottom right
(0,1) - Top left
(1,1) - Top right

Note the z coordinate indicates the distance from the camera. So use farClipPlane here if you want to get the corners of the far clipping plane. If you want tthe corners of the near clipping plane, use nearClipPlane.