I retrimmed my entire house, base, casing, and crown because it had a mixture of trim and I did not like any of it. This is not all the trim I've done but it is the most extensive. I installed several pre-hung doors during this process. For about 95% of the fasteners I used my cordless 18 gauge brad nailer made by Ryobi. I have a 16 and 15 gauge nailer as well as a 23 gauge pinner. I used all of them at various points. But for the vast majority of fasteners, 18 gauge works well (holds plenty well enough) and makes a smaller hole easier to hide during paint prep. I also paint the trim before installation, touch up the nail holes and any damage, and apply another coat of paint after installation (also filling the gap between casing and jambs with caulk).
To those suggesting 18 gauge is not big enough I suggest you try removing trim installed by with 18 gauge brads and see what fails. I think you will find that the trim almost always fails. The head of the brad pulls through or the trim breaks. 18 gauge pulls the trim as tight as necessary and holds fine for most situations. I used 2 inch 18 gauge brads.
I used 15 gauge nails installing window sills. I used sills that were an inch thick and I noticed the 18 gauge brads were not pulling it in tight enough to the window framing. So I changed to the heavier nails. I could have used a 16 guage, the more pointed nose of the 15 is just easier to get in place sometimes. 15 also holds a little bit better. But if the 16 gauge was handier at the moment, I used it.
On all the windows I put the casing under the sills with returns on it. I've picture framed it before but decided to do it the other way on this house. I used the 23 gauge pinner on the little returns.
I got prehung doors both with the casing installed and split casings and with traditional one piece jambs and separate casing (I prefer the latter but had to wait longer to get them). When the casing was installed it was installed with narrow crown 18 gauge staples. They make an ugly hole in the trim but hold really well. That is another option to using bigger nails where you need more holding. I think they put staples on the pre-hungs because they know most trim carpenters are going to hang the door by the casing without any blocking so it has to hold the door up. I am not that lazy and I don't like the staple holes in my trim so I prefer the traditional jambs.
This is already long so I will make one more point. I have nailers made by Bostitch, PC, Ryobi, Milwaukee, and Harbor Freight. For infrequent use and a pneumatic nailer my more recent purchases have been from Harbor Freight. They are much less expensive and work well. I prefer cordless to eliminate the compressor hassle but I can't justify cordless nailers for everything I do so I just have the 18 gauge and framing nailers in cordless. For a minimum setup, I would get an 18 and 16 gauge nailer from HF. Both would cost less than one nailer made by Bostitch. But if you must have only one, I would agree it should be a 16 gauge (unless you want to spend a little more and get a 15 gauge). I think two is a lot better because it will help make the trim look better but a 16 or 15 will install everything and an 18 won't.