corns1lky it depends on the situation. Essentially there is no obligation upon you and if fostering a or any dog didn't work out (for you or the dog) rescue would step in and take him back.
Assuming all goes well though your foster dog may be with you for a short while so you can, say, teach him what a home life is like and some basic behaviour skills, he may be with you indefinitely until he finds a forever home, he may have a home lined up and be with you until all the checks are done and he moves into it or you might agree to a fixed term - for example, taking a dog in overwinter who would otherwise have to live in an outside kennel.
It all depends on what fits with the fosterer and then what dog is suited to them, if any... and a good rescue will be prepared to tell you that they don't think you'd be suited or that they don't currently have the right type of dog for you.
The dog may be young or old - and often it's the oldies most in need, some of them just need a warm fire and a cosy home. What will generally be required is the willingness and ability of the fosterer to update the rescue with photos and their assessment of how the dog is getting on with the home, family, visitors, car, bus, even the Hoover in some cases where the dog may have been kennelled up unto that point, as is the case often with Greyhounds for instance.
If you were considering it my advice would be to contact several rescues and see what they have to say and what they would offer - not just in terms of what dog but what sort of back-up - and then weigh up whether it's for you. All rescues differ as to their foster policy so please don't assume that because you met one you liked or didn't like that they will all be the same.
If anyone wants to foster and wants to run the policy of a particular rescue by me please do, I'm happy to read through it and see if I can identify anything which you might need to ask, clarify or be concerned (or exceptionally happy) about.