Once program is loaded using Arduino IDE, into RTC DS3231 it should run by itself using Lithium battery and my Arduino Uno should be detached. I am not sure about which port of RTC DS3231 should be connected to Relay and how to make it run by itself.
You've got the right idea giving the DS3231 its own battery so that it can keep track of the time. The DS3231 can run on a coin cell battery for a year pretty easily, but what you're trying to do - make the DS3231 control a relay by itself, isn't really possible. The DS3231 is just a real time clock - all the DS3231 does is keep track of the time, and report the time over the I2C interface if it's requested. It doesn't control anything - it just provides information that a microcontroller (like the arduino) can use to make decisions.
I'm guessing you want to detach the Arduino Uno from your circuit because the Arduino will drain your battery if it stays connected to your circuit. Unfortunately it's the only part of your circuit that can control the relay, or make the decision if it's time to control the relay, so it has to stay.
Basically, you need to have the Arduino check the time on the RTC periodically, and every time it checks the time, it decides whether or not it needs to change the state of the relay. The simplest way to do this is probably to provide external power to your circuit so that the arduino can stay active. If power is lost, the RTC can still keep track of time with its battery, and when the power comes back on, the Arduino can go back to checking the time to see if it's time to switch the relay.
If you really need the entire system to run entirely on a battery, you will definitely need to have the arduino go to sleep most of the time, and only wake up occasionally to see if it's time to trigger the relay again.
Try Kevin Darrah's video on using an RTC to wake up an Arduino occasionally, and put the Arduino into an ultra-low power state when it's between checks. Kevin has other low power videos that are also very informative.
https://www.youtube.com/watch?v=GvZCmH6BFHw