Tap and release G within 4 frames
(60 frames per second, so you have to tap and release in 4/60 of a second or 0.067 seconds)
After pressing G, a 7 frame passive window will begin and the JG window will activate in this window as soon as G is released. Any attacks connecting during this active window will be JG'd.
For example:
If I press G and release it on the next frame (perfectly input) what I have done is input G on frame 1, released on frame two, so for frames 3, 4, 5, 6 and 7 I will JG any attacks that hit here.
If I press G and release it on frame 4 (slowest possible) I will only be able to JG for frames 5, 6 and 7, which is a much smaller window.
Pressing guard after inputting your JG will immediately cancel the window, so you can't double tap G, you have to have the balls to not block.
Fail a JG attempt (not JG anything) and you have to wait (I think 30, possibly 20) frames before you can attempt again, any attempts before this will not give a JG window, so you can't just mash out JG all day.
JG successfully and you can immediately try again.
For example, if you JG'd the first hit of Pyrrha BB and recognised it in time, you could also JG the second hit without having to wait. This is good to know against characters like Xiba with moves like 6B K, 6B K BE, where you can identify an extra attack incoming and handle it accordingly.
(Obviously, if you JG'd 6B K second hit and saw the BE, you would just step and launch him instead, but w/e, it was the first thing that came to mind, lol.)
To JG a low attack, just tap 2G in the same way. You can be holding 2 before and after tapping G, it doesn't matter.
That's basically everything you need to know about JG, hope it was helpful.