The simple answer is that when you are no longer working due to medical condition which you expect to last in excess of 2 months, you should file immediately. There is a “durational” component to disability claims. What that means is that in order to qualify for disability benefits, the medical problem causing you to be disabled must have lasted or must be expected to last for a time period of 12 months or more. The point here is that medical issues which cause someone to be unable to work but only for a short time (that is, less than 1 year) are not problems for which federal disability benefits can be awarded.
This often comes up when a person is injured, say a simple fracture, but the fracture is expected to heal before 12 months. Routine surgery is another example. A person who has had surgery, which is a very invasive procedure, is typically returned to their pre-surgery state of well being within less than 12 months. Another example is a severe case of the flu. Normally, this type of illness is resolved well within the 12 month period. If that matter is resolved within the 12 month period, then disability would not be awarded.
However, if the fracture results in a non-union causing an inability to weight bear; or if the surgery did not heal the illness or injury of if the flu developed into some other medical issue that did last more than 12 months, then in all of these instances the 12 month durational requirement may have been met.
If you do expect your illness, injury or surgery to cause you not to be able to do any job for a period in excess of 12 months, then you should consider filling for disability. This is true despite any remorse you may feel for not being able to work. A delay in filing may result in an inability to claim all of the back benefits to which you may be entitled.