Depends on the type of injury. I had a late onset of osgood schlatter's that lasted a year, but got over runner's knee in a few weeks. If it's just a case of runner's knee, check out your shoes, look at whether your mileage climb was too steep, that kind of thing. If it's a muscle problem you can do rehab to strengthen it, if it's a bone problem (stress fracture or something of the sort) then rest/cross training (that doesn't hurt it) might be your only options.
You said you just finished your first marathon, so if that means you are a beginner runner, you may lack the bone density/muscle strength to be racing that distance right off the bat. Don't run on it if it hurts, testing how long you can run to see if its better will not help!