As far as the "how long can I take it" question, I'm not sure. I know some doctors will prescribe for a maximum of three months, but I've heard of people being on it much longer.
Tanning beds are bad for you anyway, with or without phen. (But I'm sure you already know that.) With that said, I still go occasionally, though... it's the best thing I've found for when my face breaks out. (Yep, I'm 38 going on 14!

) It seems to me that a tanning salon I used to go to had a list of meds that you shouldn't be on while tanning because it could amplify the effects of the tanning bed. I -think- phen was on it. Check with your tanning salon and see if they have a list like that. If not, I'd at least cut down on the time tanning and see how it affects you.
Good luck with your journey!