It depends.  See the brief explanation at “I won in court.  So why can’t I recover my attorney’s fees?”