How can I reattach this pivot bracket for bifold doors to the wall?
I would expect that behind the drywall at the bottom is a 2x4 plate running horizontally that the vertical studs rest on.  The bracket should be low enough that you can use a 2 inch screw and anchor to that.

You may want to repair the drywall before you put the bracket back.  Its hard to tell from the photos if the damage is light enough that you can fill it with joint compound or if you will need to patch the drywall. See this question for drywall repair tips.