First, be sure your door leaf is square. Old doors tend to sag, where the hinge side top gap is correct but the latch side gap is wide. Also, you'll see the latch strike is low on the jamb's strike plate.
If the door is out of square, you can re-square the door, or you can re=hang the door frame to match the out-of-square door.
You've noted neither jamb is plumb, which means it is very much vertical. You should re-hang your door. You'll find lots of great instruction on hanging a door. Here are one I like:
https://www.familyhandyman.com/doors/repair/fix-sagging-or-sticking-doors/