You mean total, even outside of battle members?
It's certainly possible with events. At any event where you would otherwise add an actor, you could first check the number of party members like so:
@>Control Variables: [0000: ABC] = Game Data: Other: Party Members
@>Conditional Branch: Variable [0000: ABC] < 4
@> # Add party member events
: Else
@> # Event to say your party is too full
: Branch End
It would also be doable through scripts of course, but in this case I expect it would be better to do it through events since that way you can set up events for what happens when a party member does not want to join - maybe set up an evented way to trade members too.