Most schools provide information for parents on this. (If they don't, they should - you can ask.)
For very young children, in nursery or reception classes, it may not be appropriate to have "homework". Some schools ask parents to do reading with their children at these ages but this is generally learning 1 word and encouraging the child to talk about what is happening in the picture. This might take 5 or 10 minutes and should be fun for both parties.
As children get older, more time can be spent on homework. For a child of 6 or 7, probably a maximum of 20 minutes. If they haven't finished their homework then, there is no point in both parties getting upset. Put the homework away. Either they don't understand or they don't want to do the homework. If it's lack of understanding, try to find a fun way of helping them to understand. You may also want to talk to the child's teacher. If it's "not wanting", then you will need to find ways of motivating your child into doing the homework.
A child of 10 or 11 years of age can do up to 1 hour of homework a night but really, this should be a maximum, unless they are studying for exams over a short period. A young person of 16 years could do up to 3 hours of homework a night, though most probably don't.