After looking at several definitions,Vectors are quantities having both magnitude and direction.Heat has a magnitude and also a specific direction(from higher temperature to lower temperature)...so why is it considered as a scalar but not as a vector?
Heat, by definition, does not have a direction. It is just the amount of energy transferred some thermal process. The quantity you're asking about is the heat flux, which is a vector. (Note that heat does not have to travel from higher to lower temperature; it can and does go the opposite way!)
Similarly, energy does not have a direction. If you have an electromagnetic wave traveling in some direction, it carries energy with it. That energy still doesn't have a direction. Instead, there's a new quantity, the Poynting vector, that is a vector and describes the direction of energy transfer. That is the way it is with heat. Even when heat is moving, we don't say the heat has a direction. Instead we define a new quantity for that.
Heat flows from one body to another. Consider 2 persons A and B. A has 10kg(of some stuff) in his hand and B has 20kg in his hand. If A gives 2kg of this stuff to B, I state "2kg has flowed from A to B." But mass is not a vector. Q amount of this quantity flows decreasing its value at the source by Q and increasing its value at the receiver by Q. It is all about the definition and the laws that govern the quantity. You may even succeed in defining a vector quantity closely related to heat. As Mark says, heat flux is the vector you are looking for.
To add to the other already good and simple answers, let me add the following analogy.
Think of heat $Q$ as you would think of e.g. speed $v$ or distance $s$.
- Speed is considered a scalar without direction, because it is the magnitude of velocity $\vec v$, which does have direction.
- Distance is similarly considered a scalar without direction, because it is the magnitude of position $\vec s$ that does have direction.
- And keeping that thought, heat $Q$ can be though of as the "magnitude" of its vector counterpart - whichever that might be - which would define a related direction.
Such a heat vector counterpart is not something I have ever seen defined. So it might simply not ever have become useful enough for anyone to "invent", define and name. As heat (as an energy amount that is being transferred) is already a kind of "fluffy" and not very tangible term, its directionality is not an easy concept to think of.
Not even the closely related term heat (flow) rate, being an energy-per-second measure, is defined with direction. Only when reaching a term like heat flux (as pointed out in another answer), being an energy-per-second-per-area measure, do we start caring about the direction and thus define it as a vector. Only here does directionality start to become relevant and useful.