On Mac, the maximum number of open files per process is indeed 256 (which is extremely st*p** to keep so many files open for weeks, unless it is a system monitor type of process and that should be a Daemon.)
You can increase it by using ulimit.
On Linux it is - usually - 1024, which is a silly amount over weeks, and can also be increased by using ulimit.
On windows, it is not the handles, but the capacity of the filepaths, 260ísh, which can be set in the registry or the group policy.
Why would you want so many files actually open per process? That is rare.
You can try cat /proc/sys/fs/file-max to see what is the total number the system allows overall.(trillions)
[edit] Better set/getrlimit, because ulimit seems to be obsoleted in the future. Still works, though.
Close files when not needed or waiting, cache them and opening them when approached/needed.
Al this is, I hope explained, OS specific.