Alternator Issue, going down the road and everything dies? on 2002 Ford Ranger

I was driving down the road and everything shuts off, and the truck doesn't wanna start so I added water to the battery thinking maybe a dry cell, wasn't that so I get a jump it starts up and runs for a little bit and shuts off again, so I think maybe the alternator, but now that it has sat for a few hours it has started agin and is running, what is the deal?

Asked by for the 2002 Ford Ranger
the battery wil at times recharge itself to a point. have complete charging system ck'd out