Well I believe the average number is 45 hours of lessons, but it's impossible to know even roughly how many hours you'll need until you start learning.
As to the theory, definitely start learning it before you start doing practical lessons as the two help each other. I wouldn't look to take the theory test too early though. I think there's something about having passed it not too long before you pass your practical. As it can take a while to book in a practical test you don't want to risk having to re-take the theory test, esp if you fail the practical first time (or more).