Yes, once you have paid all your monthly payments for the contract length, you entirely own your phone. At this point, you can choose to end your contract with no further payment obligations, or you can continue your contract and upgrade to a new phone. In most cases when you upgrade, you can keep your existing phone, however some networks now allow you to swap your existing phone for a new phone in exchange for a cheaper upfront cost or monthly cost.
It’s always best to get in contact with your network once your contract ends. They usually will offer your better deals available to the public in exchange for your loyalty. You can also haggle for a further reduction of your monthly payments or for an even better phone. See our guide on How to upgrade your phone and get a better contract deal.