Use "excuse me" for something which is very minor or not important. For example, if you lightly bump into someone, say "excuse me". Also you can use "excuse me" to get someone's attention, especially if you do not know that person.
Use "sorry" for something which is a bit worse. For example, if you bump into someone and they fall down, say "sorry".