I'm surprised that other members consider for correct there. The correct word is by.
You extend something by + period of time.
I can extend my stay by two weeks. :tick:
I can extend my stay for two weeks. :cross:
In the OP sentence, as long as I wish is filling the 'period of time' slot.
I think I agree though that as long as I wish is causing problems here, so I'd suggest replacing it with however long I want.
If you have a question about the English language and would like to ask one of our many English teachers and language experts, please click the button below to let us know: