By default, StampPDF Batch applies a six-digit Bates number. However, you can use the -j option to allow you to specify the number of digits for Bates numbering. Here is an example:
stamppdf -p -j 4 -o outfile.pdf stamp.txt input.pdf.
The above will apply a four-digit Bates number.