Nope, afraid not. You need to stay in the area (map) to get credit for any events.
Events remember who participated, even a little (e.g. a single hit - one that does damage, that is - on an event-related NPC or target, or handing a single item to the collector NPC for collection events) and will reward you with at least bronze-level participation as long as you stay in the area instance*.
Let's say there's an event in Gendarran Fields - if you leave that area, whether that's by going to WvW or PvP, or you walk or waypoint out, you won't get credit. Distance doesn't matter, just being in that area until the event finishes.
This goes for World Events as well as Group Events and normal events. If, as you say, you received credit (gold/karma/XP) for an event that you only did a little for, I'm sure you must have remained in the area.
Even going to another instance of the same map counts as leaving it, e.g. by right-clicking on a party member who's in another instance and doing "Join in (area name)".
*As pointed out by Vael Victus in the comments, note that getting credit for (bronze) event participation (gold/karma/XP for any contribution) is not always the same as getting enough credit to earn the additional chests, for which you may need more than a token one-hit contribution.