When I run for example (time ./sort1 random5000.txt) it gives me real, syst, and user time. But if I run the same command again it will gives me different time results! I can't understand why this scenario happens. Knowing that this difference doesn't follow certain pattern, sometimes time increased and other time it deceased.
If you're using the cs50 IDE, it's a virtual machine(vm), running in parallel with many other processes on the physical hardware. Depending on how many other processes are running, your command spends time waiting rather than running. If another process is using any resource (such as the disks), yours has to wait for a turn.
In order to do the lab, you need to run all the combinations, consider the run times, and infer information. If you're seeing a small difference between runs, it shouldn't matter. If there are lots of other process (probably other vm's) running, it might skew the results a little. Concentrate on the "user" time, rather than the real time. The real time will be the most affected by other processes. The user time should only count when your process is getting it's turn.