Question: I know this could be a strange question. But was there any algorithm ever found to compute an NP-problem, whether it be hard or complete, in polynomial time. I know this dabbles into the "does P=NP" problem, but I was wondering whether there were any particular instances when people were close to it. I've also heard about the factoring number problem being solved by a quantum computer by Shor's algorithm. Would this count as an algorithm which solved an NP-problem in polynomial time please ? Please do ask if you want me to clarify any parts in my questions. Thanks in advance.

Answer: 
By definition, if you were to find a polynomial time algorithm for an NP-hard (or NP-complete) problem, then $P=NP$. So, short answer is - no.

However, its possible to think instead of solving the problems fully, to [approximate a solution](https://en.wikipedia.org/wiki/Approximation_algorithm), or [to solve them randomly](https://en.wikipedia.org/wiki/Randomized_algorithm). There are attempts at attacking from those points of view, but they are not perfect at all. Randomization isn't known to help "as-is", and many NP-hard problems are known that are also hard to approximate (finding an approximation will yield $P=NP$)

There are also attemps taking a look at notions much *stronger* than the usual turing machine. For instance, the quantum computer can be considered one. Another obvious example is the non-deterministic turing machines, in which - by definition - $NP$ would be in polynomial time.
The other answers are correct, but f I may add an observation: it seems like you are conflating classes of problems and particular instances. There are a number of instances that can be solved in polynomial time in classes that are NP-hard in general. For instance, Boolean satisfiability is NP-hard in general, since it reduces to 3SAT. However, there are a bunch of instances called Horn clauses which can actually be solved in linear time. Notice that these instances are a subset of all instances of SAT. If you do not know whether the instance you have to solve is a Horn clause, the problem is NP-hard. If you do know that your instances are restricted that way, you have HORNSAT, which is in P. It all depends what your input potentially could be, and complexity goes by the worst-case instance.