Unpick a side seam on the jeans leg with the hole, whichever seam is not flat-felled but just a single seam, using a seam ripper. You are trying to get it open far enough to fit it successfully under your sewing machine needle. Probably at least 4" below and above the hole, but I just eyeball and unpick a little more if I need to.
Cut a rectangle of scrap denim or other sturdy cotton fabric and put it inside the jeans leg under the hole. Pin it on the outside of the leg to mark the boundaries of the patch; you are going to sew on the right side, so you want your pins on the right side marking where the patch is underneath.
Now start at one end of the patch and sew back and forth in close zig-zags - I do parallel to the waistband of the jeans, but I suppose you could do parallel to the leg seams - which is attaching the patch. I sew more densely over the holey/weak area, but I do patch generously beyond the hole, too, as insurance against more holes. The pins are marking the upper and lower limits of the patch, but you pull the jeans out of the sewing machine and check what's going on back there. I usually trim the patch a little bit where the sewing didn't get all the way out to the edge.
Turn the jeans leg inside out, match up the side seams, and sew it closed. I sew a straight seam and then zig-zag the edges together to mimic the serged edge. Done!
Sometimes I mend holes in knees by hand. I use lighter-weight fabric for the patch and a field of hand stitches in perle cotton, contrasting or matching. Here's Phoebe wearing a pair of jeans with both knees mended in blue perle cotton with blue fabric inside.
Genevieve is at this link wearing hearts on her knees.
Ben at this link has a monster on his knee.
I show a friend how to patch jeans' knees.