If you got a form rejection for the first work, the agent will probably have forgotten your name by now, so you could requery at once.
If the rejection was personalized and didn't include an invitation to submit something else, then I'd wait a month or so.
If you did get an invitation to submit something else, be sure to remind the agent of it in your second query.
Finally, if the rejection was in ANY WAY personalized (not form), send the agent a thank you note for her time and attention. Then wait a couple-three weeks before resubmitting.
There, that's all simple, right?

And send that thank you for a nonform rejection whether you resub to that agent or not. Writers should encourage such generous agent or editor behavior whenever possible.