The infinitive in this phrase is "to leave," and it is functioning as an adverb.
Adverb infinitives are used to modify verbs. This in an adverbial modifier of purpose: "to leave" is modifying "got up," therefore, it is explainin the reason for which she has gotten up.