Life on a WWII-era British submarine was, in many ways, awful. They were consistently cramped, damp, noisy and smelly. They were too hot in the tropics, and freezing cold in the North Sea.
The crew lived in the forward half of the boat. The enlisted men lived in the bow compartment, just aft of the torpedo room. This was where they ate, relaxed, and slept. It was also where the torpedoes were stored, tested and maintained. There was little space for these functions, though as torpedoes were fired, the crew gained a little space. The petty officers, engine room crew and officers had their own individual messes aft of the bow compartment. These were small cramped spaces, with bunks and a table. The submarine had bunks or hammock space for about two thirds of the crew, meaning that you had to share your bunk with another man. The overcrowding was made worse by the fact that the addition of things like radar meant that the submarines were carrying more men than they were designed for. There was no privacy; you would always be sharing your space with others trying to eat, sleep or relax. The only man aboard to have space to himself was the captain, who had a small space, curtained off from the rest of the submarine in which he relaxed and slept.
Washing facilities were minimal. The boat had no showers, and carried little fresh water for washing. Soap was provided, but was rarely used, given the lack of water. The boats had two-three toilets for the whole crew. In the early part of the war, they could only be used when the boat was close to the surface, though this was improved as the war went on. Emptying them was a difficult process, requiring several valves to be opened and closed in a precise order. If this was not followed, then you'd 'get your own back' as the pressure outside the boat blew the contents of the toilet back onto you. The toilets could not be used if enemy ships were nearby, as it was a noisy processs that caused a significant disturbance on the surface. In these cases, 'sanitary' buckets had to be used. Both options were generally unpopular with the men, and so some chose to go without using them for as long as possible - with betting on this taking place on some boats. There was no provision for washing clothes, beyond the hand-basins in the toilets, and no way to dry them ether, especially in the damp environment of the submarine. In any case, most men wouldn't change clothes during a patrol. The lack of washing facilities meant that the boat soon stank of unwashed men. This was compounded by the smell of the toilets, by the smell of diesel exhaust, and of stale food to create a disgusting stench.
The boats were uninsulated, and for much of the war, had no air conditioning. This meant that they were very damp inside. The bulkheads were often wet with water, and the floor was often covered in a mix of water and oil. In northern waters, the boats were freezing cold, with the crew being forced to wrap up warm. In preparation for an patrol off the Kola Inlet in 1939, the crew of Trident were issued with fur-lined flying suits, though these would prove to be unnecessary. In the tropics, though, the lack of air conditioning was sorely felt. Heat-related health issues were common, even though the crews discarded much of their uniforms. Ultimately, one boat would be forced to withdraw from a patrol due to heat exhaustion of the whole crew. Following this, air conditioning was fitted to the 'S' and 'T' class submarines. These were very popular - and mean that, despite the overcrowding, crews preferred to sleep aboard in harbour in the Far East. Air conditioning made the boats much more habitable, and provided some extra fresh water for washing. The air conditioning did little for the air quality, though. After long periods submerged, there was significant CO2 contamination, limiting submerged time to about 30 hours. At first, this was fought by spreading CO2 absorbers and releasing bottled oxygen, but these methods were rather inefficient and ineffective. A more effective method was developed and trialed by the end of the war, but saw service on only a single boat.
Food provision was similarly poor. There was limited storage for fresh food, with just a single refridgerator. Fresh bread and vegetables would be packed into every possible corner. However, in the damp atmosphere, they soon rotted or went stale. Anything that was still edible picked up a taste of diesel. Once the fresh food ran out, the crew had to resort to tinned food. This often meant monotonous meals of tinned corned beef, along with endless cups of tea. Compounding the problem of food was the fact that, at first, the submarines didn't carry trained cooks. Instead, the task was handed to ratings who might, or might not, be able to cook. Later in the war, some ratings were given proper training in cookery, and the quality of tinned food improved. Food could only be prepared in certain circumstances. The boats had poor stability when surfaced, which made cooking difficult on the surface. Fortunately, the galley was all-electric, allowing it to be used underwater; however, it could not be used when enemy patrols were nearby, to avoid alerting them by making noise.
One good spot, though, was the issue of clothing to the men. At first, this was somewhat shoddy, with thin oilskins that offered little protection from spray, let alone rain and waves. From 1941, though, the RN began to issue the 'Ursula' suit. This was named for HMS Ursula, whose captain had developed it from a civilian motorcycle outfit. It was a two-piece suit, produced by the Barbour company, made from waxed cotton, with a warm lining and elastic at the waist and ankles. It was waterproof, comfortable to wear and very waterproof (one prototype withstood being sprayed by a fire hose). Under this, the crew would wear the cream roll-neck woolen jumper ('wooly-pully') that was a tradition amongst RN submariners. In the much hotter Far East, though, crews tended to wear as little as they could get away with.
The British submarine force followed a fairly standard routine, spending the day submerged and surfacing at night. In dangerous areas, the boat would submerge before dawn, and sail at 2-3 knots using the electric motors. The crew would be at 'watch-diving' station. Under these conditions, a third of the crew would be manning the boat at any one time. The other two thirds would be sleeping, resting, playing games or doing minor maintenance. The fraction of the crew on duty changed every four hours. To avoid using up extra battery power adjusting the trim of the boat, the crew were instructed to move around as little as possible. This also helped to reduce the CO2 contamination, with the crew exterting themselves less. Hot meals might also not be available, again to save battery power. The boat would surface again after nightfall. This was generally welcomed by the crew. Surfacing meant fresh air, the ability to smoke, and the issuing of the rum ration (1/8th of a pint). Breakfast would be eaten shortly after surfacing, lunch three hours later, and dinner about four hours after that. The batteries would be charged, and more significant repairs made. The boat would remain on the surface, enjoying the freedom to use its more powerful diesel engines, until it was close to dawn and time to submerge again.
The experience of British submariners was fairly typical. The German U-boats were even more cramped and unpleasant, with the problems of the British submarines being magnified by the more condensed conditions. American submarines, though, were more luxurious. They had more extensive air conditioning and better provision of food and similar luxuries (see /u/illuminatirex's answer on American submarine food here).