A comma before and, but, or, or any of the other conjunctions FANBOYS is needed in two conditions
1. When we have three or more items in a series.
2.When "FANBOYS" is being used to coordinate two independent clauses.
In your case, I would say it's wrong to use a comma, because (and how long) is considered a dependent clause which is only could be understood by going to the independent clause (how many pages will you write).
Examples of using a comma before and
[Miguel took piano lessons for sixteen years], and [today he is an accomplished performer].
[The ice storm last week caused many tree limbs to fall on power lines], and [many people were without electricity for days].
Examples of not using a comma before and
Miguel took piano lessons for sixteen years and today is an accomplished performer.
The ice storm last week caused many tree limbs to fall on power lines and left many people without electricity for days.
I hope this is clear enough.