How to determine number of alpha hydrogens in a cyclic compound?
The relative stability of your two compounds is not determined by arguments based on hyperconjugation.  Rather the relative stabilities have to do with ring strain.  Placing a double bond in smaller and smaller rings increases the angle strain in the ring system.  A double bond, being roughly $\ce{sp^2}$ hybridized, would prefer to have bond angles around 120°.  This becomes difficult in 3- and 4-membered rings where the internuclear angle is 60° and 90° respectively.  Therefore molecules containing double bonds in 3- and 4-membered rings will be more strained than molecules with the double bond in a larger ring.

Edit: Response to OP's comment

No, the given solution is not the correct answer to the problem.  It is correct that structure B has more alpha (alpha to the double bond) hydrogens (4) than structure A (only 2 alpha hydrogens).  It is also true that hyperconjugation can be used to explain why alkyl groups attached to a double bond act to stabilize a double bond (see this earlier answer for an explanation), and that the double bond in B is more stabilized by hyperconjugation than the double bond in A.  However, hyperconjugation has a much smaller effect on the stability of these molecules than the ring strain effect.