How to write numbers one after the other in different context
Solution 1:
Many style guides (some? My papers must conform to Turabian's Manual) say to either use numerals or spell out the numbers—don't mix and match formats. That said, I find five 2-hour sessions to be more readable than five two-hour sessions.
Solution 2:
Yes, in general it is a good idea to not mix formats, but if the phrase starts a sentence, then you'll want to spell out the first number, then by convention, the second number should be numeric (as it is less than 20 or whatever limit is set by your style guide).
On the other hand, you also should mix formats if it would otherwise be confusing. Also I've heard that mixing formats should be done if you are counting different kinds of things, again, just to avoid confusion.
Solution 3:
I agree with the previously-mentioned preference for five 2-hour sessions, with "5 two-hour sessions" nearby in preference. However, what I would do for a case like this is to reword the phrase as either of the following.
five sessions of two hours each...
two-hour sessions, five in number...