Understanding of Histogram-of-Oriented-Gradients
How this 36*1 came and how we calculated it? 


HOG is an algorithm which:


works on a portion of the image, called "detection window";
divides the "detection window" in a certain number of cells;
associates an histogram (of oriented gradients) to each cell.
Each histogram has N orientation bins. WLOG, here, we'll consider N=9);
"Normalization step" (to make histogram values not affected by lighting 
variations): it creates blocks (where each block is made up of 4 cells 
(2x2)), and it overlaps them;
creates a vector for each block (so, 4 cells x 9 orientation = 36 components for block)
creates a final vector, associated to the overall "detection window";
the final vector is passed to an SVM classifier.


At each iterations, the "detection window" scans the whole original image, and the HOG algorithm is applied at each scan.


  and is it compulsory that we always need 9 bin vector? Is it a fixed size for HOG?


No, the usage of 9 orientation bins for each histogram is not mandatory; it's only a trade-off to which the authors came through tests, as stated by MimSaad.

In this paper, it is explained that increasing the number of orientation bins improves performance significantly up to about 9 bins; beyond this value, perfomance doesn't improve considerably.
Figure 4b shows this result.