It depends on the child, some stop at the age of 3 and some stop at the age of 7 or older, this does not mean that the child is incapable of bladder control it just means that the child's body isn't ready yet. One can't make the child stop wetting the bed, but this can cause distress. maybe these tips will help you.
- If the bed does get wet during the night, simply explain to the child that this is normal and that it will go in time
- place plastic sheets under the cover of the bed do the urine doesn't soak through
- wetting the bed can be distressful to the child so it is important not to influence this as being wrong and shameful as this can create problems later on in life.
- make sure that the child has been to the bathroom before bed and perhaps wake them up within an hour of getting into bed to make sure that they need to go.
But i assure you this will stop in time, whether the child is 2 or 8, it will stop, the best thing you can do right now is to praise the child for the good things they are doing and comfort them when this happens, this can be very embarrassing for them too.