Someone being in a situation that they are unfamiliar or unsuited for.
Example: If someone has never been to the gym but decided to go for the first time, they would probably be unfamiliar with some of the exercise equipment there. Thus, one might say this person looks like 'a fish out of water.'
Fish are right at home in the water, it's where they are most comfortable. If you take a fish out of that environment and drop it onto dry land, well, it's obvious what will happen. The fish will wiggle and flop around as it desperately tries to get back to home. Thus, with this expression, a fish being completely out of their element while on land is being applied metaphorically to people who look like they are uncomfortable in certain situations.
This phrase goes back to at least the year 1483, as it is written by an English poet named Geoffrey Chaucer in a work of his:
"...a huge man, uncouth; a master of vessel and knew all the ports; not ride well; like a fish out of water as sat on
Reference: Newspaperarchive contained a digital copy of the newspaper with the quote above.
Note: The history, or the origins of common idioms can be difficult to trace down, so finding the precise time a saying came into existance is no walk in the park. What you will usually find on this site are moments in history where an expression started to be used on a widely-known basis. For instance, a lot of popular sayings can be spotted in old newspapers from several decades ago, but think about that for a second. If an idiom is being used in the media, it seems apparent that everybody already knows about it! What does that mean? Well, it means the origins of the phrase are probably much older.
For the most part, what you'll find on this site are early usages of particular expressions, usually coming from aged books, plays, poems, or newspapers. It's meant to give you an estimate on how long certain phrases have been used for, but not necessarily where they originated from.
KnowYourPhrase.com - Meanings and Origins of Phrases
* Tim arrived at the farm to do some hard work, but since he was used to living in a big city, he looked as if he were a fish out of water.
* I was invited to sing at my friend's wedding, but when I got up on stage in front of a crowd I realized that I haven't done something like this in a while and felt very much like a fish without water.