This TechNet article is fantastic, I recommend you bookmark it. It lists the ports used by various Windows services and is quite thorough.
In versions of Windows earlier than Vista/2008, NetBIOS was used for the "RPC Locator" service, which managed the RPC name service database. But in Vista/2008 and beyond, the RPC Locator service is no longer necessary or useful. It's vestigial. From this point on I am only going to talk about MSRPC on Vista/2008+.
Ports 137, 138 and 139 are for NetBIOS, and are not required for the functionality of MSRPC.
All the ports used by RPC are as follows:
RPC EPM TCP 135
RPC over HTTPS TCP 593
SMB (for named pipes) TCP 445
Ephemeral Range, Dynamic *
Other applications, such as Remote Desktop Gateway, will use RPC over HTTP proxy and use port 443, etc.
Although the article I linked to above lists the NetBIOS ports, those are legacy and are not required for RPC, assuming you can acquire name resolution through other means (DNS,) and assuming the remote service itself is not dependent on NetBIOS.
Port 145 is bogus. It's not used for anything. Wherever you heard that it "makes things better," is wrong.
Basic MSRPC uses ports 135, and the high-numbered dynamic range. That high-numbered dynamic range is ports 1024-5000 on XP/2003 and below, and 49152-65535 on Vista/2008 and above. You can also call that port range ephemeral ports.
You can define a custom port range if you wish, like so:
reg add HKLM\SOFTWARE\Microsoft\Rpc\Internet /v Ports /t REG_MULTI_SZ /f /d 8000-9000
reg add HKLM\SOFTWARE\Microsoft\Rpc\Internet /v PortsInternetAvailable /t REG_SZ /f /d Y
reg add HKLM\SOFTWARE\Microsoft\Rpc\Internet /v UseInternetPorts /t REG_SZ /f /d Y
netsh int ipv4 set dynamicport tcp start=8000 num=1001
netsh int ipv4 set dynamicport udp start=8000 num=1001
netsh int ipv6 set dynamicport tcp start=8000 num=1001
netsh int ipv6 set dynamicport udp start=8000 num=1001
TCP port 135 is the MSRPC endpoint mapper. You can bind to that port on a remote computer, anonymously, and either enumerate all the services (endpoints) available on that computer, or you can request what port a specific service is running on if you know what you're looking for.
Let me show you an example of querying the RPC Enpoint Mapper:
C:\>PortQry.exe -n 192.168.1.1 -e 135
Querying target system called:
Attempting to resolve IP address to a name...
IP address resolved to host01.labs.myotherpcisacloud.com
TCP port 135 (epmap service): LISTENING
Using ephemeral source port
Querying Endpoint Mapper Database...
UUID: 6b5bdd1e-528c-422c-af8c-a4079be4fe48 Remote Fw APIs
UUID: 7f1343fe-50a9-4927-a778-0c5859517bac DfsDs service
UUID: 3473dd4d-2e88-4006-9cba-22570909dd10 WinHttp Auto-Proxy Service
Total endpoints found: 50
==== End of RPC Endpoint Mapper query response ====
You will notice that if you perform that query on the local computer, you will find many more endpoints than if you perform the query from a remote computer. That's because many RPC endpoints are not exposed remotely and are only used for local interprocess communication.
Further reading: http://technet.microsoft.com/en-us/library/cc738291(v=WS.10).aspx
And also: https://www.myotherpcisacloud.com/post/2014/02/16/verifying-rpc-network-connectivity-like-a-boss.aspx