They should always be the people who will be best able to attest credibly to your talents in a professional/academic capacity. Always check with the referees beforehand to get their agreement.
Unless you are applying for an academic job or further study, you will typically need two referees. As a student, you should normally get a tutor and a past employer, if possible. They should not be relatives. If possible, let your referee know when you need the reference returned by.
Unless you are making academic applications, try not to worry too much about references. For most non-academic positions, the offer is made and accepted before the references are called for. So typically it is only in academia that the reference needs to be impressive to influence the hiring decision. For most non-academic jobs the reference is a due diligence step.
We are often asked, for how long after moving on it is still valid to use a referee from your past. There is no general rule but you can help yourself by actively maintaining relationships. Some PhD supervisors and even some tutors become life-long friends with their former students, exchanging greetings cards and socialising periodically. In this case, there is no limit to how long you can call upon someone to be a referee. So always seek to form strong cordial relationships with all contacts in the University and in the workplace.
Dr Mike Moss, Careers Advser for Alumni, says:
Students ask me what it takes to be successful and there are many factors. But most important is to go out into the world and make lots of friends and no enemies. It is never worth winning an argument and losing a friend. Bake cakes, buy beers, socialise at lunchtime. The more you can turn your tutor or supervisor or other senior people into sponsors who support you and push you forward for things, the more successful you will be.