The optimal size for your images in pixels depends on the size of your book and the PPI (Pixels per inch) setting on your images.
Here is a table setting out the recommended image size in pixels, assuming you are using the recommended setting of 72 PPI: https://leanpub.com/help/manual#leanpub-auto-page-sizes-and-maximum-image-sizes.
For any Leanpub book, you can find guidance for images if you go here:
...making sure to replace YOUR_BOOK with your book's unique web address.
You can see and change the size of the PDF version of your book if you go to your Book Theme page here: