What are these 240p, 360p, 480p, 720p, 1080p units for videos? What's the basic idea behind it?

From this entry in Quora

240p, 480p, 720p, etc. are Video Resolutions which denote the vertical resolution. However "P" does not stand for "pixels" but for "progressive".

720p means that all 720 lines are drawn in each frame.

It is the opposite to Interlaced (denoted as "i") where just half of the lines is drawn each frame. So the numbers give you vertical resolutions.

Most Common Video Resolutions are the following ones:

352 x 240(240p)(SD)
480 x 360(360p)
858 x 480(480p)
1280 x 720(720p)(Half HD)
1920 x 1080(1080p)(Full HD)
3860 x 2160(2160p)(Ultra-HD) (4K)