Only by command: component max_stack_size it's a stack of objects from 1 to 99. No more than 99 games will be accepted by the command /give @s minecraft:ender_pearl[max_stack_size=100] responds with an error even before execution. Ready-made commands are in “Briefly” at the top.

An item with durability cannot stack: if it has max_damage, and the stack is greater than 1, the game will refuse to give out such an item. Therefore, a stack of swords or pickaxes cannot be made even by a command.

The usual pile of things that are not listed above is 64. The rest of the items are on the page components for /give.