Вот один вариант использования sprintf
library(ggplot2)
library(tidyverse)
library(ggpubr)
p <- ggboxplot(ToothGrowth, x = "supp", y = "len",
color = "supp", palette = "jco",
add = "jitter",
facet.by = "dose", short.panel.labs = FALSE)
p + stat_compare_means(aes(label = sprintf("p = %5.4f", as.numeric(..p.format..))))

Обновление
В ответ на ваш комментарий вы можете сделать следующее
p <- ggboxplot(ToothGrowth, x = "supp", y = "len",
color = "supp", palette = "jco",
add = "jitter",
facet.by = "dose", short.panel.labs = FALSE)
p + stat_compare_means(aes(label = ifelse(
p < 1.e-2,
sprintf("p = %2.1e", as.numeric(..p.format..)),
sprintf("p = %5.4f", as.numeric(..p.format..)))))

Здесь я печатаю p-значение, используя научную запись, если p < 1.e-2
else как число с 4 цифрами.