Light the Room Optimally Suppose i have A candles.When I lights up a new candle, it first burns for an hour and then it goes out. I can make B went out candles into a new candle. As a result, this new candle can be used like any other new candle.
For how many hours can candles light up the room if we acts optimally well? 
EXAMPLE: 
Say A=4 and B=2
Then answer is 7.For the first four hours lights up new candles, then  use four burned out candles to make two new ones and lights them up. When these candles go out (stop burning), I can make another candle. Overall,we can light up the room for 7 hours.
 A: This is a slight development of Hagen von Eitzen's answer:
An hour's burning consumes $\frac{B-1}{B}$ of a candle.  
This means each candle's wax is almost enough for $\frac{B}{B-1}$ hours of light: as there is always some wax unburnt at the end of the process and only integer numbers of hours of light are possible, there can be no more than $\lceil \tfrac{AB}{B-1} \rceil -1 $ hours of light, assuming $A$ is positive.


*

*For $B=2$ this give $2A-1$ hours of light.  

*For $B=3$ and $A$ even it gives $\frac32 A - 1$ hours while for $B=3$ and $A$ odd it gives $\frac32 A - \frac12$ hours.   

*For $B=4$ and $A$ a multiple of $3$ it gives $\frac43 A - 1$ hours, while for $B=4$ and $A$ one more than a multiple of $3$ it gives $\frac43 A - \frac13$ hours, and for $B=4$ and $A$ two more than a multiple of $3$ it gives $\frac43 A - \frac23$ hours.

*And so on, with the same pattern for larger values of $B$.  
A: After we burn off the original A candles, we can make $\lfloor \frac{A}{B} \rfloor$ more candles, since as you say yourself, you can use B used candles to make 1 "unused" candle.
When those burn off, we can make a further $\lfloor \frac{A}{B^2} \rfloor$ candles. 
Given that each candle burns for an hour, that leaves us with $A + \lfloor \frac{A}{B} \rfloor + \lfloor \frac{A}{B^2} \rfloor$ hours so far. Do you start to see a pattern?

Note that after you do this though, there could be a few spent candles that aren't immediately made into another candle. We also have to account for those accumulating too. Try a few small examples, and in each example, write $A$ in base $B$. You should see a pattern forming between the digits of $A$ in that representation and the amount of leftover spent candles.
By request, I'll elaborate a little more on what I mean here. Let's take $A = 15, B = 2$ to illustrate.


*

*When you burn off 15 candles, you can make 7 more from the 15 spent candles, leaving
an extra spent candle 

*After you burn off those 7, you can make 3 more from the 7 spent candles, leaving an extra spent candle 

*After you burn off those 3, you can make one more from the 3 spent candles, leaving an extra spent candle

*Now, you burn off this candle, leaving another spent candle.


Note that I said "leaving an extra spent candle" 3 times, so after we burnt that last candle, we actually have 4 spent candles left over, not just 1. As you mentioned in the question, that means we can accumulate another 7 hours of candle.
A: With $B=2$ the answer is simple: $2A-1$.
To see this, note that a candle can actually burn two hours, but it goes out when there is still half a candle left. In the end we will have one half-candle that we cannot fix, so we had $(A-\frac12)\cdot 2$ hours of light.
With larger values of $B$, the answer is not quite so simple. In generalization to the above, we note that a candle can actually burn for $1+\frac1{B-1}$ hours and it just goes out a bit early. In the end we will have between $1\le k\le B-1$ small pieces left, so we had a total of $A\cdot(1+\frac1{B-1})-\frac k{B-1}$ hours of light.
The main question is: What is $k$ (and can we possibly influence it)? With a bit more thinking you will notice that $k$ equals the repeated digit sum of $A$ expressed in base $B$. For example with $A=100$ and $B=3$, we have $A=1021_3$, so the digit sum is $1+0+2+1=11_3$ and then $1+1=2$, so $A=100, B=3$ will lead to $k=2$.
