The meaning is not always the same.
1. If you are learning British English, you should use a gerund after 'like' if you are talking about something you enjoy. For example:
'What do you like doing in your free time?'
'I like riding my bike.'
2. 'Like to' may have a slightly different meaning. It can suggest that this is something that you think is beneficial rather than enjoyable. For example:
'I like to ride my bike to work. It's tiring, and not very pleasant in bad weather, but I need the exercise.'