If I buy an app from the app store, do I have to stay logged into the app store? This question says that you can install the same purchase of Lion on multiple non-commercial Apple machines.

The accepted answer states the same applies to all App Store purchases.

My question however is, once you install something from the app store onto a 2nd machine, do you have to remain logged into the app store.

For example. My girlfriend just got given a mac with Snow Leopard. I want to log into the app store on her machine, install Lion, but then log out, and leave the app store logged into her Apple account.

Is that ok?
Yes, although there are many questions that cover the same ground already on SE.

You can DL app store apps (including Lion) on your girlfriend's computer. Then she can log into her own apple account and buy other apps. The only thing you need to be aware of is that for updates, you can only update the apps you bought with that particular account. So if you want to update Lion (not likely as it will come through software update) or other apps, you will have to re-log into your account.

I believe most apps have a 5 computer limit.