How are the standard errors in the coxph function in R calculated? According to Fox, "The column marked z in the output records the ratio of each regression coefficient to its standard error, a Wald statistic which is asymptotically standard normal under the hypothesis".
The Cox model finds regression coefficient values that together maximize the log partial likelihood of the survival data. As the Wikipedia page notes, the inverse of the Hessian matrix (matrix of second-order partial derivatives of the log partial likelihood) evaluated at those estimated regression-coefficient values provides an estimate of the covariance matrix among the regression coefficients. This Cross Validated page provides more background for the general idea. The standard errors for the individual coefficients are then the square roots of the corresponding diagonal entries of the covariance matrix. Note that if you want to test hypotheses about contrasts among the coefficients you need to incorporate the off-diagonal entries of the covariance matrix appropriately, as the estimates of the coefficients are not independent.