It depends on whether the string representation is in base 10 or base 16.
Conversion to/from base 10
Normally, when an integer is represented as a string, it is represented in base 10. Then here is the running time:
It depends how you count. Theoretical analysis requires a model of the time it takes to do different operations, and depending on which model you choose, you get a different answer.
One way to count running time is to assume that each basic operation takes one unit of time, and that you can add, subtract, multiply or divide two integers (no matter how large) in one step. If you adopt this approach, then it is possible to do the conversion in $O(n)$ time.
Another way to count running time is to assume that each basic operation takes one unit of time, but each operation can only work on a fixed-size value: for instance, you can add or multiply two 32-bit integers in one step, but you cannot add/multiply arbitrary-size integers in one step (that might require many steps). If you adopt this method of counting, then the natural algorithms for conversion take $O(n^2)$ time.
The former approach to modelling runtime is typically more appropriate when working with small numbers (e.g., that fit into a single machine register). The second is often more appropriate when working with very large numbers.
Conversion to/from base 16
However, the main answer there proposes converting to base 16 (without really highlighting that is what it is doing). It turns out that converting to/from base 16 is much faster: it can be done in $O(n)$ time with a straightforward algorithm, regardless of how you count running time.