Even though you're not mapping a data column to the colour or shape aesthetics, you can create "dummy" aesthetics for "mean", and "median" that will generate a legend. To dodge the points, you can use position_nudge(). For example:
library(tidyverse)
ggplot(starwars,aes(sex, height)) +
stat_summary(fun.data = "mean_cl_boot", aes(colour="mean", shape="mean"),
size = 1, position=position_nudge(x=-0.1)) +
stat_summary(fun=median, aes(colour="median", shape="median"),
size=4, geom="point", alpha=1, position=position_nudge(x=0.1)) +
labs(title = paste0("test"), x = NULL, y = NULL, colour=NULL, shape=NULL) +
theme_classic() +
scale_colour_manual(values=c("blue", "red")) +
scale_shape_manual(values=c(16, 5))

Created on 2022-02-17 by the reprex package (v2.0.1)