Fixing a door hinge when the part of the board it was attached to is gone?
The wood next to the stone wall rotted.
You have a stone foundation.  Those are never perfectly sealed.  Moisture got thru and rotted the piece of wood next to the stone.  Maybe moisture came thru the wall or maybe up thru the ground.
Remove the door and set it aside.  Now you will be looking at the rotten piece of wood attached to the stone wall.  Get rid of it.  If you want a set up like you had, put a new piece there that is the same size.  When you get the old piece out you will see how it was attached to the stone.  Maybe there will be some holes in the stone you can use for the new piece.  Then put the door back where it was and attach the hinges to the new piece of wood.
It occurs to me that this would be a fine job for that fake plastic wood which will fill the space and receive the hinge from the door, but not rot.  Or at least use some wood full of preservatives!