No, you are not required by the patent office to have a patent attorney file your patent application. But a patent attorney can certainly help.
An experienced patent attorney can save you lot of time, money, and prevent mistakes that might not be correctable.
Whether a provisional patent application, non-provisional (utility) patent application, or design patent application, the US patent office has a ton of rules that must be followed when filing an application. If the rules are not followed, the patent office will likely reject your application.
Upon receiving a rejection, you must respond in writing. Again, there are rules to follow. If you fail to properly respond and/or fail to timely respond, your patent application may become abandoned.
Experienced patent lawyers understand the patent office rules, or at least know how to find/follow the applicable rules. They also have technical expertise that enables them to describe your invention to the patent office - whether mechanical, chemical, electrical, software, or pharmaceutical.
And experienced patent attorneys can properly respond to the patent office rejections of your application. It is not unusual for the patent office to reject a utility application several times. Often, the rejections are because your invention is "obvious" in view of prior patents.
To respond to the rejections, one must be able to describe how the patent "claims" in your application differ from the prior patents. It may also require amending your patent claims to further distinguish your invention from the prior patents. This can best be handled by a patent attorney, rather than one who has little experience in filing patent applications.
Indeed, laypersons often end up going to a patent attorney after they file the patent application on their own. Often, it is due to the fact that the patent office has rejected the application, and the layperson is at a loss for what to do.