This will depend on several factors:
- your age and overall capability of learning new languages
- your history of studying foreign languages
- whether you are taking classes or not
- if you do take classes:
- the type of the class
- how many hours per week
- for how many weeks
- the quality of the school (but less than one would think)
- how much time you can devote to study outside of class
- and, very importantly, how strongly you expose yourself to the language:
- whether you have German friends and colleagues
- whether you make an effort to speak German in situations where you could get by with English
- whether you read German literature (simple, of course) or watch and listen to German TV / News / other media
There are many more factors, but this should be enough to show you how it is impossible to give you a definite answer.
That being said:
B1 is defined in the Common European Framework of Reference for Languages as (Wikipedia) »Threshold or intermediate«, and the following qualifications are required to pass the exams:
- Can understand the main points of clear standard input on familiar matters regularly encountered in work, school, leisure, etc.
- Can deal with most situations likely to arise while travelling in an area where the language is spoken.
- Can produce simple connected text on topics that are familiar or of personal interest.
- Can describe experiences and events, dreams, hopes and ambitions and briefly give reasons and explanations for opinions and plans.
The media portal Deutsche Welle estimates that 300 to 400 hours of study are needed to attain these capabilities.
If you attended a course with 4 hours of class per day, four times a week (that’s a normal workload for someone who wants to learn a language fast in a foreign country), you’d study 16 hours per week, so 20 weeks of class should easily get you to point where you can take the exam.
In my personal experience with fugitives from Arabic countries, I can say that some people are much faster and some require more time, but B1 should definitely be attainable within one year!
To estimate the cost for all of this, you should find a language school near your location and ask them directly: this is very hard to tell since the rates vary from school to school, and we can't possibly tell how many hours of class you need to take.
Also, better learning conditions like private lessons or small groups will make it more expensive.
Just to give you a ballpark figure:
the language school Colon in Hamburg charges 510 Euro per month for an intensive course (5 hours a day, five days per week), and they say it takes about 7.5 months of this particular class to reach B1 or ten months to reach B2.
They are among the more expensive schools, but you can do the math.