You can manually configure your IP address or you can (as most do) have the router assign it automatically when you connect.
A typical reason for manually assigning an address is that you want to contact your machine remotely, so need to know its specific address on your own network.
If it's manually assigned then it will always remain the same; if its auto-assigned it may or may not be the same the next time you connect. Neither of these conditions is affected by changing your hard drive (or any other bit of kit - except the network card - and only then if you configure the new card differently from the old one).
And, no, if you have two computers connected to the same router they CANNOT have the same IP, else the router can't tell them apart!
When you go to a site such as
http://www.whatsmyip.org/
the IP it tells you is not that of your computer, but that of your router, which is how the rest of the Internet sees you.