I think you can get what you want with something like this, using the {lubridate} package (see here for a book chapter with details):
library(tidyverse)
library(lubridate)
#>
#> Attaching package: 'lubridate'
#> The following objects are masked from 'package:base':
#>
#> date, intersect, setdiff, union
df <- data.frame(
stringsAsFactors = FALSE,
sampling_date_time = c("2021-10-12 07:48:43",
"2021-10-12 08:05:23","2021-10-12 08:22:03",
"2021-10-12 08:38:43","2021-10-12 08:55:23","2021-10-12 09:12:03"),
sunrise_date_time = c("2021-10-12 12:35:38",
"2021-10-12 12:36:07","2021-10-12 12:36:35",
"2021-10-12 12:37:05","2021-10-12 12:37:33","2021-10-12 12:38:05"),
sunset_date_time = c("2021-10-12 21:11:54",
"2021-10-12 21:11:26","2021-10-12 21:10:55",
"2021-10-12 21:10:25","2021-10-12 21:09:54","2021-10-12 21:09:25"),
period = c("night", "night", "night", "night", "night", "night"),
depth= c(236.660054398857,
263.628220939748,248.269863472482,143.411453432879,
118.336918769495,184.596392521635),
Value= c(3.81517529411765,
4.09484308571429,3.06502731428571,2.76729708571429,
2.65774266666667,2.72782291891892)
)
# Helper functions
day_start <- function(datetime){
hour(datetime) <- 0
minute(datetime) <- 0
second(datetime) <- 1
datetime
}
day_end <- function(datetime){
hour(datetime) <- 23
minute(datetime) <- 59
second(datetime) <- 59
datetime
}
# Convert everything to proper datetime objects
df <- df %>%
mutate(across(ends_with("date_time"), as.POSIXct))
df %>%
ggplot() + theme_bw() +
geom_rect(aes(xmin = day_start(sampling_date_time), xmax = sunrise_date_time,
ymin = min(depth), ymax = max(depth)),
fill = "grey") +
geom_rect(aes(xmin = sunset_date_time, xmax = day_end(sampling_date_time),
ymin = min(depth), ymax = max(depth)),
fill = "grey") +
geom_point(aes(sampling_date_time, depth, colour = Value)) +
scale_colour_gradientn(colours = c("yellow","red")) +
scale_y_reverse() +
theme(
axis.text.x = element_text(
angle = 90,
hjust = 1,
vjust = 0.5
))

Created on 2022-07-11 by the reprex package (v2.0.1)
Isn't it a bit weird though that you have (slightly) different sunrise and sunsets for the same day? Here the grey blocks are overplotted, so the earliest sunset and latest sunrise are the only one visible, but if the values of sunrise and sunset are supposed to depend on depth (for example), you'll have to change y to something appropriate.