Penguins sleep on both land and as they float at sea. It is not unusual for penguins to sleep standing up, although they also sleep laying down.
When penguins have eggs to keep warm and protect from the cold, it is common for them to sleep standing up or even huddled together in groups to stay warmer as they sleep. Penguins sleep with their flippers out as a measure to retain more body heat. When penguins are molting, they sleep more than usual as part of a strategy to conserve energy, since they don't eat much during that time.