wallet.change_gap_limit(number)
Instead of this solution that requires to restart Electrum, I'm providing another one that doesn't have this requirement.
Go to
View -> Console and type:
for i in range (n): print (wallet.create_new_address(False))
If you want to generate receiving addresses or:
for i in range (n): print (wallet.create_new_address(True))
If you want change addresses. Replace
n with the number of addresses you want to generate.