Why is p value different in same hypothesis? 
wilcox.test(weight ~ group, data = my_data, paired = TRUE)

wilcox.test(weight , group, data = my_data, paired = TRUE)


can anyone specify the difference to me with "," and "~" both are giving different outputs, whereas i use ggplot to see the data second one gives me the correct result that there is a difference in groups.

These are totally different commands. In the first one, the syntax tells the function to stratify the weight according to the group and compare the weights of your groups. I suspect that you want this. In the second one, the syntax tells the function to compare the weights to the group labels, which I suspect are coded as $0$ and $1$. Depending on what you're weighing, I would expect all of the weights to be much higher than $1$. Consequently, the distributions of weights and 0/1 group labels are totally different, and the test catches this.
EDT
You're doing a paired test, so to be a bit more detailed, the first syntax tells the function to do a test on something like weight[group == 1] - weight[group == 0], while the second tells the function to do a test on weight - group.
