Difference between tf.layers.conv1d vs tf.layers.conv2d
tf.layers.conv1d is used when you slide your convolution kernels along 1 dimensions (i.e. you reuse the same weights, sliding them along 1 dimensions), whereas tf.layers.conv2d is used when you slide your convolution kernels along 2 dimensions (i.e. you reuse the same weights, sliding them along 2 dimensions).
So the typical use case for tf.layers.conv2d is if you have a 2D image. And possible use-cases for tf.layers.conv1d are, for example:

Convolutions in Time
Convolutions on Piano notes
What is the difference in the functionalities of tf.layers.conv1d and tf.layers.conv2d in tensorflow and how to decide which one to choose?