Hiring a lawyer for a social security disability claim is not mandatory. Some folks try to go through the process by themselves, and some are successful by themselves. The disability process is complication, and there are a number of times during the process when you can hire an attorney.
Some attorneys, like me, will help with the initial application if somebody asks, and if the application is successful and the client gets disability, they can go on their way and they do not owe me anything.
You can also wait until your initial application is denied or after your initial appeal is denied, or even up to the point of a hearing. It really depends upon how much work you want to do and how comfortable you are with the process. A big reason to hire a lawyer sooner rather than later is the lawyer will be able to provide clarity to the situation and the process.
Remember, you have an overworked government employee reviewing your application and all your materials. If you are able to clearly show the examiner while you are entitled to disability, it can make the process so much easier for them to award you disability and grant your application.