Time Complexity of Rabin-Karp matching algorithm
As pointed out by vzn above, the wiki article has all the details you are looking for. 

Firstly, what is pre-processing and what is the online runtime, depends on what is remaining constant and what is varying. For example, if we are given some fixed text and are asked to match various small strings with that text, pre-processing would be hashing the text. 

In this case, let us say we have only one string to be compared with one text, to avoid confusion about pre-processing. The operations that we need to perform are


Hash for string to be searched for ($p$) = $O(m)$
Hash for each $m$-sized substring in the text ($T$) (assuming rolling hash) = $O(n-m+1)$
Number of hash comparisons (one per each $m$ sized substring in $T$) = $O(n-m+1)$
If there are $r$ matches in the hashes, then we compare each of those substrings of $T$ with $p$ (each comparison being $O(m)$) = $O(rm)$


But in worst case, the number of matches in hash can be as large as $n-m+1$. So worst case complexity will be $O(m(n-m+1))$.