If you are behind a proxy, IntelliJ might not be configured to use it.
Go to: File → Settings → Appearance & Behavior → System Settings → HTTP Proxy → Configure proxy settings (or set to "No Proxy" if unnecessary).
File → Settings → Appearance & Behavior → System Settings → HTTP Proxy