If P is equal to NP, then what happens to the problems those can be solved in polynomial time?
First of all, it is not clear what you mean by an algorithm which is able to solve any problem in NP; usually one algorithm solves one problem. However, given a polynomial time algorithm for solving some NP-complete problem, you can solve any NP problem in polynomial time. However, every problem will require a different algorithm.

This doesn't necessarily affect problems which are already in P. Indeed, we have unconditional lower bounds on search and sort which show that no $O(n)$ sort or $O(\log^* n)$ search algorithm exist, in restricted computation models. Even when tight bounds are not available (or when you consider a computation model for which good lower bounds are not available), there is no reason to assume that an algorithm for NP-complete problems is relevant.

On the other hand, if P=NP then more difficult problems are affected: you can show using a padding argument that P=NP implies EXP=NEXP, for example. But the implication doesn't go the other way around.