At what stage of the project should you apply for NSF funding? Before working on it at all? Once you have a working paper? I'm mostly thinking in terms of economics or similar social sciences without large lab costs.
You should apply for grants at the beginning of the funding cycle. Most funding agencies provide specific dates during which they accept grant applications. Depending on the subject, there can be a funding cycle every 6 months, 8 months, or a year. For the NSF, as far as I know, the funding cycle for the Social Sciences and Economics is an annual cycle, with the deadline in August.
If your research is around halfway through by that time, I think it would be best to apply, because if you choose to wait for the completion of the work, you might have to wait for a long time. However, if you have just started your research, maybe it would be a good idea to wait and apply for funding in the next cycle. So basically, I would recommend preparing for grants application once you have enough clarity about the direction in which your study is heading.