A framework is usually a very large software library thar your own software is built upon, like a foundation. Such libraries tend to be very feature-rich, and command a lot of attention in their respective domains. One tends to say “I develop using the <whatever> framework” almost the same way one would say they use a certain programming language, because using a framework often forces you to write software in a very specific way.
A template, I’m less certain of. I am not sure if that means anything specific across all of software development. It could mean a number of things depending on context. In general, though, it usually means some form of exactly what you’d expect it means — you have a thing that’s serving as a base, and you can customize it somehow to turn it into something else.
A framework is like a toolbox – it provides tools to build something. For example, Angular is a JavaScript framework which you can use to build web applications. It avoids developers having to ‘re-invent the wheel’.
A template is more like a built Lego kit. It’s a ready made thing that you can adapt to your needs, but it’s not really something you can make just anything with.
A template is when they give you a bunch of code as a starting point, and you change it to make the thing you want.
A framework is where you fill in the gaps in someone else’s code but don’t change it. Usually you don’t see the code in the framework, same as with a library. In fact from the computer’s point of view, frameworks and libraries are the same thing – the difference is the programming style.
Note that “template” means something different in C++
Latest Answers