There are dozens of different programs out there. Some have reciprocity with others, meaning you can use miles you earn on one to fly on another if they are partners or in the same alliance. Yes, you can claim miles for flights you have flown recently. Which one is best will depend on a few things.
Where are you based out of?
What are your most common destinations?
What type of fare do you travel under typically?