Both... and...

I would like to know the meaning of this sentence.

Both Book A and Book B weight 5 pounds.
Does it mean
each book weights 5 pounds?
Or
Two books together weight 5 pounds?

Thanks.

Remember that ‘weigh’ is the verb and ‘weight’ is the noun. In your sentence you would have to make it clear: Both book A and book B weigh 5 pounds each or Both book A and book B weigh 5 pounds together.

It can mean either. In common usage, further context would clarify which it means.

Thanks for your correction.
Please allow me to try another sentence.

Frank Lampard scored more goals than both D.Sturridge and Juan Mata this season.

Looking at this sentence, does it mean F.Lampard scored more goals than Sturridge/Mata each or the combined goals of Sturridge and Mata?

Again you would have to make this clear.

Frank Lampard scored more goals than either D.Sturridge or Juan Mata this season.

Frank Lampard scored more goals than both D.Sturridge and Juan Mata combined this season

Assuming this is the statement with no further context, Frank Lampard scored more goals than both D.Sturridge and Juan Mata this season.

Does it mean it can mean either? Or the sentence is grammatically wrong?

It isn’t grammatically wrong, it’s just not clear as I have tried to explain above. You can say: ‘either’ or add ‘combined’. I really can’t say any more on this point.