Concept of Gravitational potential energy Change in Potential energy corresponding to a conservative force is defined as $$\Delta U = U_f - U_i=-W_f$$ and gravitational potential energy is $$\Delta U = U_f-U_i = -W_g $$ Suppose a mass $m_1$ is kept at a fixed point $A$ and a second mass $m_2$ is displaced from point $B$ to point $C$ such that $AB = r_1$ and $AC = r_2$.
$\therefore$ , $$\Delta U = -W_g = \int{\frac{Gm_1m_2}{r^2}}dr$$ $$U(r_2)-U(r_1) = Gm_1m_2\left(\frac{1}{r_1}-\frac{1}{r_2}\right)$$ Now I am free to choose any reference point thus if I take potential energy at  $U(r_1) = 0$ and $r_2 = \infty$ Then I will get potential energy at infinity as $$U(\infty) = \frac{Gm_1m_2}{r_1}$$ which I think is wrong as a reference point at $r_1$ the potential energy at infinity should be infinite.
So where I am wrong, is my concept of gravitational potential energy wrong itself.
 A: If you let $r_1$ go to $0$ with nonzero $m_1$, you've defined a region with positive mass and zero volume, hence infinite density. That's a gravitational singularity. Whether such things exist or not is anyone's guess, but if they did, they would be the centers of black holes.
While Newtonian gravity won't accurately describe such a system, it is correct that for an object starting at a gravitational singularity, it would take infinite energy to lift the object to any radius $r>0$.
For a uniform density sphere of density $\rho$, radius $R>r$, the mass under a given radius from the center $m_1(r) = \frac {4\pi \rho}{3}r^3 $, and $U(r)$ simplifies to $\frac {4\pi \rho G m_2}{3}r^2$

You find similar apparent infinities with other forces. The specifics differ but in each case the answer is that the case in which $r \to 0$ is a situation in which your model doesn't describe anything real. This can be because there's nothing real to describe that has the modeled characteristics, because reality with such characteristics represents a case in which the model is inapplicable, or both.
A: 
I think is wrong as a reference point at r1 the potential energy at infinity should be infinite.

The potential energy at infinity is only infinite if it takes an infinite amount of work to get to infinity. However, because the gravitational force decreases rapidly with distance, a projectile rapidly reaches a space where the force of gravity is not strong enough to reverse its velocity. Potential energy keeps increasing, but there is a maximum value that is approached asymptotically.
We have actually built space probes that have escaped Earth's gravity and the Sun's gravity. Voyager 1 and 2 have exited the Solar System and are never coming back. If they don't run into anything, they will reach arbitrarily far distances. The only thing stopping them from actually reaching infinity is the infinite time it would take to get there. To reach such a state, it only took the energy in the rocket fuel and some kinetic energy stolen from planets during planetary slingshots.
There are systems with a potential energy that reaches infinity at infinite distance. The spring potential energy $U = \frac{1}{2}kx^2$ is an example. When $x=\infty$, $U=\infty$ because the spring force keeps getting stronger as the spring is stretched.
A: No the equation that you have derived isn't wrong. What actually is at fault here is the logic that potential energy at infinity must be infinite. This is completely incorrect. For example consider the following equation:
$$a-b = c$$
In this equation the only given information is the difference in magnitude of the two said quantities (a and b). Therefore if the value of b turns out to be 0 then $a=c$.
Since you have not provided any background as to why you think the potential must be infinite hence I cannot supply any intuitive answer for it.

Regarding the comment:

I thought that the potential energy at infinity should be infinite because as we increase the distance from the fixed object the gravitational potential energy increases

Consider that you have fixed the value of $U(r)$ at $r=r_0$ to be $c$. As you correctly state that Gravitational potential energy increases as we go away from that point. Therefore $U(r) > U(r_0)$ if $r>r_0$. But what you failed to notice is that the rate at which the difference $U(r)-U(r_0)$ grows gets slower and slower as we go away from $r_0$ because $F_g$ (Force of gravitation) gets smaller and smaller. This when evaluated as limit gives a finite value and hence the value is not infinite at infinity.
A: Other answers are making this way too complicated.
The potential energy equation you quoted is only valid outside of a uniform sphere of mass. Inside a uniform sphere, the potential energy is actually constant. Therfore that constant should be set to the minimum of potential energy.
$U(r < R) = C$
$U(r=0) = U(r = R) = C$.
We make this C negative out of convenience so that it's 0 at $r = \infty$.
