How do I know what the maximum appropriate current for the base is? Not just in this application, but any future ones as well.
The gate behaves like a capacitor, and the resistor limits the inrush or peak current draw (from your I/O pin) when the state of the MOSFET changes. MOSFETs are voltage controlled devices, not current controlled devices like for example BJT transistors are.
The exact peak current depends on not only the gate capacitance, but also on the I/O pin slew rate and such. I am not aware of any generally used simple formula to calculate it, although I think one could approximate it starting from a low-pass RC filter model.
If your logic level voltage is V, and the limiting resistor R, you can definitely say that even the peak current is limited to I=V/R
or less. In most cases, it will be much less. A 220Ω resistor on a 3.3V I/O pin will limit the (peak) current to 15mA; a 1kΩ to 3.3mA.
As the gate acts like a capacitor, the resistor will also affect the time it takes for the MOSFET to change state. In between the initial and final states, the MOSFET will act very much like a resistor (whose resistance varies), and thus dissipate energy exactly like a resistor would as heat. Therefore, it tends to matter most when the switching happens often.
My own favourite logic-level or signal N-channel trench MOSFET is
NXP NX138AKR. It is very similar to BSS138 MOSFETs available from several manufacturers, but slightly faster due to smaller total gate capacitance. Using a 220Ω resistor on the gate pin at 3.3V I/O, switching is fast enough to at least 100 kHz digital signals. Its gate-source threshold voltage (which is really a curve!) is also low enough to be used down to 2.5V I/O levels without any worries or extra consideration. (I originally arrived at it because it was A) cheap and easily available in SOT23-3, B) slightly faster than BSS138, and C) because NXP has a nice SPICE model for it I could use in KiCAD et cetera to model the circuit behaviour.)