Which one is easier to remember
I would say it depends on the kind of memory that prevails on the user:
- Declarative memory would prefer a numerical password, since it "consists of information that is explicitly stored and retrieved".
- Procedural memory would prefer a gesture, since "it is revealed when one does better in a given task due only to repetition".
Here a statistic on which is the prevailing one would come handy, but I can't give any scientific evidence to prefer one over the other. My bet would be that gesture-based is easier to remember. (I personally like gesture, I even remember phone numbers and PIN codes based on the gesture.)
But then you are forcing the user to have an exclusively new gesture to remember, where as most of the people would reuse a long ago remembered code, like their PIN number, date of birth, etc.
In the end, I feel they are quite balanced, and it comes down to using gesture for its novelty or not using it because it's patented.
Which one is better to execute
If it is for an app that can run on different devices, then we have to take the kind of inputs available into account: mouse vs. trackpad vs. qwerty keyboard vs. numeric keyboard vs. touchscreen.
If the gesture is easier than the code, why haven't website login
pages adopted this?
As other answers point out, drawing a gesture on a touchscscreen/trackpad is easier than doing it with a mouse, and impossible with a keyboard. So in case the app has to be accessed using any of the latter, the code is the only way to go.