What would be best practices regarding button width on mobile apps?

I've seen buttons be smaller in width (with a minimum width of course)

like this

enter image description here

And full width until the margin like this

enter image description here

What would be best, or in which situations it would be better to choose one over another?