In many cases, there is no difference. As Mike says,' I like to play basketball' and 'I like playing basketball' mean exactly the same thing. US English tends to use the first form, while British English tends to use the second.
However, sometimes we use the 'to' form with a slightly different meaning.Take a look at thes sentences:
I like to wash the dishes as soon as I've eaten my meal.
I like to go to the dentist every four months.
I like to finish my homework before I go out in the evenings.
Here's a question for you, Chimmie. Can you see how the meaning of these sentences is different from the usual meaning of 'like' (as in 'I like playing basketball?).