Hey, Anastasia!
Both, as you already know, are interchangeable sometimes. But there are some points that can help, like:
He is just a little boy. - It suggests some sympathy, whereas "He is just a small boy" sounds more neutral, talking about the boy and maybe offering a comparison with other boys.
Another example can be: A little house. Like Ben said right above, you probably imagine a cute and charming house, but if you say "A small house", well, it's just a house (that is small), and that's all.
With this in mind, you can add another adjectives like: She's a pretty little girl. Which suggests sympathy again. What if you say "She's a pretty small girl"?
And we have the other meanings when talking about size and amount, but I believe that's not the point. Please let me know if this was helpful! :)