We are told that the hypothesis is Sample 2 $>$ Sample 1. It is actually not clear which hypothesis this is. Is this $H_0$ or $H_1$? I can take a guess and presume that $H_0$ was actually Sample 2 $=$ Sample 1, in which case the $p= 0.035337297291866368$ is the two-tailed probability. If so, and if the probability of Sample 1 $>$ Sample 2 is half that or $p=0.017668648645933184$, then we would reject the $H_0$ hypothesis that Sample 1 $>$ Sample 2 and conclude that Sample 1 $\leq$ Sample 2, which is significant, but not highly significant, so that our confidence in this result is "high enough" but not extremely convincing.
However, there is not enough information to conclude that, and more information as to what $H_0$ and $H_1$ actually were is absolutely required for proper interpretation. For example, it might be that Sample 2 $\leq$ Sample 1 is the result. More information is required for test interpretation!
What we need from OP is what was tested in R
For example, the whole output:
> wilcox.test(mpg ~ am, data=mtcars)
Wilcoxon rank sum test with continuity correction
data: mpg by am
W = 42, p-value = 0.001871
alternative hypothesis: true location shift is not equal to 0
Warning message:
In wilcox.test.default(x = c(21.4, 18.7, 18.1, 14.3, 24.4, 22.8, :
cannot compute exact p-value with ties
Now the statistic for which ever the result is, is the Mann-Whitney U-stat, see link. This is not a median or a mean difference test. In general terms, the Mann-Whitney U test is a test of location, where by location we mean something more general than mean or median.