I spent about a week to 10 days reading through one of those DVSA theory books you can get at WHSmith, passed first try. It's not so bad but watch out for the stopping distance and tire tread depth questions, you do actually need to know the specific numbers
how much time is needed to spend studying for the theory to pass it?
It doesn't take very long. You can probably pass it (or be very close to passing it) even without touching the highway code once. It is mostly "pick the least ridiculous option"