Worms can tolerate most reasonable temperatures but they cannot stand rapid rates of change. In the winter as has been said I keep mine in the garage in a tub.
In the summer I sink a plastic container in the ground in a shady spot that is about a foot square and leave the top 2" above the ground. Put plenty of air holes in the lid and keep the soil moist. I use a 50/50 mix of sifted garden soil and peat.
Look at them once a week and spray the soil with rain water if the soil looks a bit dry. Do not just feed them when you think they might need some. Only feed when you see a worm or two on the surface, this is when they are in search of food.
Feed mashed potato in small quantities, a ball a bit smaller than a golf ball at a time.
Take out 50% of the soil once a month and replace with the mixture and stir in.
I have kept worms alive and well for over six months using these methods. Come to think of it I'm not sure how long I have had my current lot, some of them are likely to be over a year old now.
I just have a Plastic Dustbin in the garden which has had an ongoing worm culture for 18 months - all I do is add Tea bags, Egg Shells, and general vegeatable waste. It has always provided me with a pleantyful supply of worms - the red ones Den....I think.
Great info, great guys, great fun, thats Maggot Drowners
Ian, I use a lot of worms and keep mine in tubs in the garage which is cool. I also feed mine with mashed potato and the odd teabag as others have already told you about. I'm still using worms that I got bought last year because they do breed and all I do is keep the new ones in a tub and feed them until they are big enough to use. I keep mine in Tomato Grow bag compost, which needs to be kept damp but not soaking wet. 
do you use them worms for crab fishing as i was told youve had crabs a few times (or was it youve caught a few Crabs in your time)im hopeless at remembering this time on a sat morn.
please could you let us knowb what type of worms, as red, brandlings,dendros &lobs all req a different way to keep
i keeped about 1500 dendros 200 lobs in 50/peat dirt mix in a five gallon kitching bin keeped in the shade feeding on mash .dendros keeped till all used up but lobs did not stay firm. tryed puting kitching waste in and found it hard to get worms out as mixed with waste