How to fold a plane while keeping length of edges?
Welcome to Blender SE cheese!

While rotating the vertices around the fold, you must align your view so that the fold points directly away from the view. All vertices along the edge occupy the same point on the screen.

Now, you can set cursor to folding line, set pivot point to cursor and rotate.

Unfortunately, it is not easy to exactly align your view. If you need full precision you can create extra geometry and then align your view to it. Then remove the extra geometry.

Start like this:


Extrude a corner vertex at the end of the folding line. Right click directly to extrude it on top of the original.

Using the opposing vertex as cursor, scale the extruded vertex up some.



Now extrude that edge to create a face. Extrude the face to create a cube.



Select the face point away from the fold and hit Shift + Numpad 7. Now, your view is exactly aligned to the edge. Rotate the outer vertex.



NB! Extruding the edge the right way may be hard sometimes. You can experiment some and see. I'm not sure.

If you don't need exact precision. Align you view the normal way and rotate away.

Good luck!