Here is my code:
\documentclass{amsart}
\usepackage{hyperref}
\usepackage[svgnames]{xcolor}
\hypersetup{%
colorlinks=true,
urlcolor=Blue
}
\begin{document}
\url{https://math.stackexchange.com/questions/2893035/propositional-logic-notation-conversions-and-naming}
\url{https://www.google.de/search?ei=zcaPW8DmHMPLwQLm_6jgBw&q=table&oq=table&gs_l=psy-ab.3..0l10.28636.29973.0.30300.5.4.0.1.1.0.191.677.0j4.4.0....0...1c.1.64.psy-ab..0.5.674....0.UqDEfSRjRB0}
\end{document}
Why the second url correctly goes to next line correctly and the first url don't (goes beyond the horizontal margin of page)?
\urlonly allows line breaks at certain points (.,\,/, ...). To avoid confusion with hyphenations, URLs are not broken after-. In your first URL there is no good break point to perform a line break. You can load\usepackage[hyphens]{url}before\usepackage{hyperref}to allow breaks after-as well. But that won't help with all URLs. So if you have further problems have a look at https://tex.stackexchange.com/q/3033/35864 – moewe Sep 05 '18 at 14:56\usepackage[hyphens]{url}already helps.\usepackage{xurl}is more radical and allows breaks everywhere, so it might mercilessly cut words in unfortunate places, but it will break the URL. – moewe Sep 05 '18 at 14:59\manualurlbreakyou have to mark up each acceptable line break with\:(good break) or\.(acceptable break). – moewe Sep 05 '18 at 15:02