Tomczak and Tomczak, 2014, The need to report effect size estimates
revisited. An overview of some recommended measures of effect size.
Trends in Sport Sciences
is a good source for effect size statistics for nonparametric tests. (And at the time of writing the article is easy to find on the internet.)
Probably the most commonly reported effect size statistic for the Kruskal-Wallis test is epsilon-squared, which is the chi-squared statistic (or H) divided by (N-1).
From the sample size and p-value, this epsilon-squared value could be determined, but you also need to know the number of groups in the KW test (or the df for the test).
The p-value and sample size can be passed to the quantile function for the chi-squared distribution for the given df. Below I have an example in R where epsilon-squared is computed from p, N, and the number of groups. And then an example where epsilon-squared is computed from the raw data.
### Create some data in three groups
A = rnorm(10, 5, 5)
B = rnorm(10, 9, 5)
C = rnorm(10, 13, 5)
Y = c(A, B, C)
G = factor(c(rep("A", length(A)), rep("B", length(B)), rep("C", length(C))))
Groups = 3
N = 30
### Perform the Kruskal-Wallis test
KW = kruskal.test(Y ~ G)
### Calculate epsilon-squared from p, and number of groups, and N
P = KW$p.value
CHI = qchisq(P, Groups-1, lower.tail=FALSE)
Epsilon2 = CHI / (N-1)
### Calculate epsilon-squared from raw data