Have you tried this solution that Link48010 posted above:
"I may have fixed this by going into Network in System Preferences, under Wi-Fi, click Advanced, and remove all prefered networks and then reconnect to your desired Wi-Fi. I have not had it drop yet, I will keep you posted."
It worked for me. There were a bunch of networks listed as preferred that my iMac had definitely never been connected to. When I deleted all but my home network it started working as normally again, logging on automatically after sleep or restart. It was as if it had downloaded the network info from my iPhone and was trying to connect to some of those first. Some were hotspots in airports, hotels, etc., and my iMac has never been connected to any but my home network.
The bad part about the beacon interval is most people here don't know what that is. To top it off it's also not in any of the troubleshooting guides people keep posting. It could possibly be a fix that no one is trying.
I've never had a problem with Windows machines in my house or Mac OS X 10.4 with the interval set to the optimum (100). When I rolled out 10.5 it started causing an issue so I set it to 50, when I got to about 10.6 I tried again back at 100 and it was fixed. Now all of the sudden it's back again needing to be at 50. And it's like clockwork too, both MacBook Pros that I have, two generations (2009 & 2010) consistently have the problem with it set at 100. My 2008 iMac had no issues on either setting with any version of OS, and no Windows PC in my house has the issue.
If you're having issues on some sort of corporate wirelss then you won't be able to modify the setting. If you have control of the wifi access point (or wifi router), login and flip through the settings until you see something like advanced wireless settings (sorry every wireless router/ap is different you'll have to check with your vendor for where this setting is located). Under these settings there will be a value called "Beacon Interval". This should usually be set to 100. As djiti pointed out this is in milliseconds (ms). If you have constant drops and I mean the icon in the upper right corner goes from bold lines to gray lines and you lose all connectivity you may decrement this number until you notice the drops go away. This does not apply to just not being able to get to the Internet. This is for a specific drop and a "disassociated due to inactivity" message in your console logs.
I would not go below 50ms on this number as it may cause network slowness issues. I believe Mac OS X Lion is pretty sensitive and needs to see the beacons consistently or it drops you from the network. Most other PCs/OSs allow a little flexibility if you lose a few of these.
From what I've read, if there are a lot of wireless networks in your vacinity you may have to adjust this number down from the default of 100 to get consistent network connectivity.
I have noticed that my entourage mail is not affected when I lift up the screen but all browsers are. So much for improved productivity. At this point in time I wish I hadn't bothered.
I have tried all suggestions and have lost an awful lot of time trying to troubleshoot this.
Come on Apple - sort this out please.
Late 2006 iMac with Lion I have this issue too. Using Airport Extreme 3rd Gen with 7.5.2 firmware. Connecting over 5Ghz n.
After wake from sleep WiFi connects fine, but DNS doesn't work. I can browse via IP fine. Restarting WiFi fixes things.
Tried everything mentioned here, including:
Removing Bluetooth PAN.
Removing and re-adding network settings.
Adding extra DNS servers.
Deleting plists and re-setting up network.
Moving order of services to promote WiFi.
Switching off TimeMachine.
Fixing Location / Adding new location.
Removing all preferred networks.
Turning round three times while saying the name of the Scottish Play.
Cannot change beacon interval as Airport Extreme doesn't allow that.
Never had any problems with Tiger/Leopard/Snow Leopard. Early MacBook Air runnung Lion connecting fine after sleep.
I think what we have here is a bug. I wonder if Apple will spot/fix it?
Well I'll add myself in here as someone with wifi dropping problems since installing Lion. I'm also on an Airport Extereme and cannot modify the beacon interval. I had a 24hr workaround (require admin password to turn wifi off) but as I mentioned to a friend that I thought it was fixed, the wifi dropped shortly after.
I have the same problem with my MBP from mid 2010 in that after it awakens from sleep it doesn't reconnect to the wifi. I click on the wifi icon, it doesn't show any wifi networks, and only then searches for them and finds them then I click on the network I was on just before sleeping and it reconnects.
Very frustrating, and as all the other posters have said, I have never had this problem in SL.