War Communism is the name retrospectively given to the economic measures adopted in Russia from the summer of 1918 when the Civil War was getting started and carried on until the middle of 1921. In this period all surplus grain was declared the property of the state, all industrial enterprises were nationalised, and free trade was banned.
Why do it?
One of the largest historical debates over War Communism concerns why it was adopted at all. There are essetially two polar views - that it was adopted for purely pragmatic reasons in response to the war, or that it was adopted for purely ideological reasons in response to Marxist doctrine. The truth is somewhere in the middle - there was, in the words of Alex Nove, "an interaction between circumstances and ideas". Many Bolsheviks, Lenin included, changed their views on why it had been adopted over time.
But it certainly pleased the Bolsheviks to adopt such good socialist solutions to the problems of the war. All the belligerent countries in World War I had seen a growth in the power of the state in economic matters, and the Provisional Government of Russia had installed a grain monopoly as well. By the time the fighting of the Civil War was over, in 1920, it was presumed by the Bolsheviks that what had worked in war would work in peace. By the middle of 1921 this was clearly not the case, and the New Economic Policy (a concession to the market) was adopted. In this we see an ideological attempt to keep building socialism, then a realisation that pragmatism demanded they act otherwise.
Feature #1: grain requisitioning
All the planks of War Communism were connected, but the main one was probably the seizure of peasant grain to feed the starving cities. The Bolsheviks were alarmed by the shrinkage of the proletariat during the Civil War - the Russian worker had always had one foot in the village, and now he was pulling the other leg back as well. To feed and clothe their vanguard class in the cities the Bolsheviks needed to oppress the peasantry, who were an essentially conservative element that just wanted to be left alone in their utopian village soviets. The terms of trade between the cities and the countryside were at the time very unfavourable, and peasants weren't encouraged to sell their food because there were so few consumables on offer.
If the peasants wouldn't sell their food, the Bolsheviks would have to take it. And take it they did, usually brutally and irresponsibly. The Red Guards, Cheka units and special detachments of "tough" workers would be sent to requisition a certain quota of food from a particular region. If it wasn't handed over, they would torture and kill the peasants until it was. Sometimes whole villages were bombarded and destroyed for their "petty bourgeois" resistance (usually they had just run out of food), and the peasants became increasingly radicalised. For a start, they'd sow less seed - what was the point if it was just going to be requisitioned? Often the Bolsheviks would take all their seed anyway, leaving them with nothing to sow the next year. In 1920- 21 there was a terrible famine which claimed more lives than the Civil War and the First World War together.
Now the peasants were really pissed off. Revolts sprung up all over the countryside, and Soviet power was shrinking. It was bad enough that at the low point of 1919 the Bolsheviks had only controlled the same amount of land as 16th century Muscovy - now they looked set to lose everything. 15,000 peasants under nationalist leadership roamed the Ukraine. To top it off, strikes were spreading through the cities at the miserable working conditions of the workers. The Kronstadt naval base - the sailors of which were the "pride and glory of the Revolution", according to Trotsky in 1917 - rebelled, and had to be viciously put down. The Bolsheviks blamed it on foreign influence, but they knew the truth. The grain requisitioning was radicalising the peasants and not placating the workers. War Communism ended when the requisitions were replaced with a tax in kind.
Feature #2: ban on free trade
Free trade was banned to try and stop grain speculators making pots of money from the famine and shortages, but the black market was huge. It is reckoned that an average urban family got fifty per cent of its food from the black market during this period. The state could not afford the resources to stamp down on free trade, and hundreds of thousands of workers travelled to the countryside with improvised goods (cigarette lighters being the most notorious - this sort of activity became known as "cigarette lighterism") to exchange for food. Industrial production in the cities broke down as people took time off to produce goods to explain for food. They pilfered the resources of their own factories to do this - and the raw materials ued in state factories were often purchased from the black market anyway!
Money was by this time worthless due to inflation, so most of the trade that took place was bartering. The Bolsheviks came to regard this "moneyless" state as a good thing, and didn't think about stabilising the currency for some time. But an alternative sprung up. Just as in post-WW2 Germany cigarettes were the usual currency, here it was bags of flour. Markets sprung up in the cities and suffered intermittent Cheka raids, but because the Communists themselves were now having trouble eating the activity often went ahead. The ban on free trade was never really quite effective anywhere.
Feature #3: nationalisation
As good socialists, the Bolsheviks first nationalised the big banks and the currency apparatus. Their next target was the large factories and industry, and eventually all industrial enterprises were de jure nationalised. Of course, the Bolsheviks had no hope of running all of them, and most simply shut down. 60,000 of the "enterprises" nationalised turned out to be windmills. The larger factories continued to operate when raw materials and fuel were available to operate them, and wages were paid in rations. The small enterprises remained de facto largely out of Bolshevik control, because they couldn't spare the manpower or resources to operate them. Administrative chaos characterised the whole set-up.
The Bolsheviks had tried to go too far, too soon.
The end of War Communism
War Communism came to an end when it was realised a strategic retreat was needed. To build socialism the state needed to accumulate capital, which meant someone would have to bear the brunt of having that capital extracted from them. It had always assumed this would be the peasantry, but this strategy wasn't really working. Lenin began to stress that the peasants would have to be persuaded to give up their old ways and accept socialism, and that they couldn't be forced. It was declared that there would be a new economic policy, one of co-operation between the peasants and the proletariat.
When the requisitioning brigades stopped and peasants were allowed to keep their surplus grain, it made sense to let them sell it. Initially they were allowed to do this only on "their local market", but due to the dire situation in the cities a national market was soon encouraged. This new policy of liberalisation was called the New Economic Policy, or NEP, and those who profited by it were called Nepmen. But more of that in its own node.
War Communism can be seen as a sort of proto-Stalinism. Because it took place during the Civil War, these were seen as heroic days to which Stalin and his supporters wanted to return. They just hoped to do a somewhat better job of it next time.